Jump to content

[SOLVED] Easy Syntax Error - using COUNT, HAVING, and GROUP BY


techtheatre

Recommended Posts

I am trying to find out how many orders in my shopping cart database have a particular "Status".  I can't seem to get this rather simple query correct.  Here is some of what i have tried:

 

SELECT COUNT(Status) FROM InvoiceData HAVING Status='Processing Payment' GROUP BY Status; 

SELECT COUNT(*) FROM InvoiceData WHERE Status='Processing Payment' GROUP BY Status; 

SELECT COUNT(*) FROM InvoiceData HAVING Status='Processing Payment' GROUP BY Status; 

 

My table is "InvoiceData" and there are several columns, but one is called "Status"...There are a variety of possible values for Status in the table.

 

THANKS!  I feel like an id10t that i cannot get this correct.  Maybe i should try sleeping... :-\

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.