• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 177
  • Last Modified:

SQL string

In a Query component I have a SQL string :
select sum(price) from customer
What do I write to add one field more?
I have tried many ways like:
select date sum(price) from Customer
and
select date and sum(price) from Customer
0
rainbowsoftware
Asked:
rainbowsoftware
1 Solution
 
hpwCommented:
Hello,

I think you should try this:

Select Date, Sum(price) from Customer

Hubert

0
 
rainbowsoftwareAuthor Commented:
select date, sum(price) from customer does not work.

I want to sum the field Price and it's OK with
select sum(price) from Customer
But when writing
select Date, sum(price) from customer group by date
the SumOfPrice shows the value of the current record and not the sum of all.
0
 
kretzschmarCommented:
hi rainbowsoftware,

you cannot have fields and the sum of all in a normal sql-statement but in a nested subquery should it go :

select date, sumoverall from customer, (select sum(price) as sumoverall from customer)

but each line holds now the total sum

meikl
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
dwwangCommented:
Tell me what do you want to have as the result dataset, and I can tell you how to do that.
0
 
kretzschmarCommented:
Hello?
0
 
rainbowsoftwareAuthor Commented:
The answer from hpw is not useable.
The answer from Kretzchmar has helped me to do the job.
0
 
kretzschmarCommented:
hi rainbowsoftware,

well then give me the points

what is going on with your q:
http://www.experts-exchange.com/Q.10097306

meikl
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now