Jump to content

Help with SQL Query


fromtheashes462

Recommended Posts

yes but I need a total count and then a count for a specific range.

 

example:

 

id,      count(col) all rows,      COUNT(col) BETWEEN x and y

 

Well, assuming you don't want to issue 2 separate queries, just use a SUM()...

 

id,      count(col),      SUM( IF col BETWEEN x and y, 1, 0 )

 

Link to comment
https://forums.phpfreaks.com/topic/66607-help-with-sql-query/#findComment-335219
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.