Solved

SQL string

Posted on 1998-11-18
7
169 Views
Last Modified: 2010-04-04
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
Comment
Question by:rainbowsoftware
7 Comments
 

Expert Comment

by:hpw
Comment Utility
Hello,

I think you should try this:

Select Date, Sum(price) from Customer

Hubert

0
 

Author Comment

by:rainbowsoftware
Comment Utility
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
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 4

Expert Comment

by:dwwang
Comment Utility
Tell me what do you want to have as the result dataset, and I can tell you how to do that.
0
 
LVL 27

Expert Comment

by:kretzschmar
Comment Utility
Hello?
0
 

Author Comment

by:rainbowsoftware
Comment Utility
The answer from hpw is not useable.
The answer from Kretzchmar has helped me to do the job.
0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 50 total points
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now