easy SQL question

Damon Pillinger daisychain at iinet.net.au
Thu Oct 13 18:38:27 CDT 2005


Hi Guys,
 
Not good enough at SQL to figure this out myself.
 
Table with two fields  name & Count
 
            name    count
            John     2
            Ben      3
            John     5
            John     23
            Ben      3
            Ben      7
            John     3
            John     8
 
 
What I want is this returned 
 
John     41
Ben      13
 
I have read up on unique and distinct but cannot figure it out, the SUM
bit is easy but I think I have to have one call for each person
 
select SUM(count) from data where name="John"
select SUM(count) from data where name="Ben"
 
and there could be hundreds of names , so this would be BAD.
 
 
RB5.5.5 Valentina 2.0.5 rel , I just want to use straight SQL if
possible?
 
Talk in the morning, have a great day/night.
 
Thanks
 
Best Regards
 
Damon L. Pillinger
Jensen 2005 by Daisychain
www.daisychain.no-ip.biz
Phone : 03 9532 1220
Fax : 03 9532 1280
 


More information about the Valentina mailing list