Jump to content

[SOLVED] Conditions based upon COUNT(*) field


mb81

Recommended Posts

Here is my query:

SELECT COUNT(*) AS countreservations,reserveddate,resourceid FROM RESERVATIONS_reservedresources GROUP BY reserveddate,resourceid ORDER BY countreservations DESC

 

I want to get a set of results back where only where countreservations>1 is returned.

 

If I try to insert WHERE countreservations>1, it says it doesn't know that column

If I try to insert WHERE COUNT(*)>1, it says illegal use of group function

 

Is there any way to get just the records that have 2 for the COUNT(*)?

 

Thanks.

 

 

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.