Jump to content

mysql SUM problem


c_pattle

Recommended Posts

I have a sql statement which is

 

select * from invoices where username="gtd" order by invoice_date

 

I want to edit it so to get the total of a field called "invoice_total" so the statement will now look like this

 

select *, sum(invoice_total) from invoices where username="gtd" order by invoice_date

 

However when I do this I now only get 1 record returned rather than before when I got 5 records returned.  Is there are way to get around this problem?

 

Thanks for any help

Link to comment
https://forums.phpfreaks.com/topic/244032-mysql-sum-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.