Jump to content

[SOLVED] Using WHERE with SUM


icuucme

Recommended Posts

I have a database that i need to get the total for a certain column but only where field 1 is a certain value..let's say

 

SELECT field1, field2, SUM(field3)

WHERE field1='30'

 

so i basically just want the sum of field 3 wherever field 1 is a certain value.

 

I get an error when i do this, how can i work around this?

Link to comment
https://forums.phpfreaks.com/topic/102945-solved-using-where-with-sum/
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.