Jump to content

Query help


Shamrox

Recommended Posts

I've got this query that I need a little tweaking done to.

 

SELECT `spec_vendorinfo`.Company_Name as name,`spec_registrar`.vendorid as vendorid, SUM(`spec_registrar`.cogs) as totalcogs
FROM `spec_registrar`, `spec_vendorinfo` 
WHERE `spec_vendorinfo`.vid = `spec_registrar`.vendorid and `spec_registrar`.orderdate >= '2007-01-01'   and `spec_registrar`.orderdate <= '2007-11-01' and totalcogs >= 10000 
GROUP BY `spec_registrar`.vendorid 

 

If you see the use of SUM on the cogs field and calling it as totalcogs.  I want to be able to specify in the WHERE section that I only want results of totalcogs over 10,000.  The way i have it written doesn't work. How would I adjust the query to use this totalcogs?

Link to comment
https://forums.phpfreaks.com/topic/78134-query-help/
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.