...

View Full Version : sql sum query



thindrakhya
11-27-2007, 02:46 AM
hi all

I am using this query and php is giving me the error

select productId , sum(quantity) from tblorderdetail where sum(quantity) > 10 group by productId


Can anyone know where i am wrong

shyam
11-27-2007, 10:12 AM
select productId , sum(quantity) from tblorderdetail where sum(quantity) > 10 group by productId
thats gotta be in the having clause


select productId , sum(quantity) from tblorderdetail group by productId having sum(quantity) > 10



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum