Jump to content

Summing columns


cpd

Recommended Posts

  Quote

Will that not just get the amount EG in this case 4 because theres 4 rows.

 

I want the sum of the values in each row not the amount of rows?

 

Umm no...

 

SELECT SUM(value) as valueSum FROM tbl_name WHERE ID IN(1,2,3,4) GROUP BY value

 

Will return valueSum = 20

 

 

Link to comment
https://forums.phpfreaks.com/topic/136065-summing-columns/#findComment-709490
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.