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
rainbowsoftwareAsked:
Who is Participating?
 
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
 
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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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
 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.