Forum Moderators: coopster

Message Too Old, No Replies

displaying unique records

         

michlcamp

5:19 am on Sep 14, 2005 (gmt 0)

10+ Year Member



I've got a database table named 'sales' where each sale has these fields:

id, item,price,salesperson

table looks like:

1 item1 2.00 bob
2 item2 3.00 bob
3 item3 4.00 bob

I want to display:
---------------------
¦salesperson ¦ total ¦
---------------------
¦ bob ¦ 9.00 ¦
----------------------

how do I write the query?

Any help appreciated..
thanks.
mc

dkin

6:10 am on Sep 14, 2005 (gmt 0)

10+ Year Member



based on what youve posted no one will be able to help you, post the column names and are you trying to only select that row or that row first or what?

mcavic

7:08 am on Sep 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



SELECT salesperson, SUM(price) total
FROM sales
GROUP BY salesperson;

dkin

7:15 am on Sep 14, 2005 (gmt 0)

10+ Year Member



lol I feel like a fool now, if thats what you wanted I just did not understand, sorry bout that.