PHPycho
01-28-2008, 06:51 AM
Hello forums !!
I am getting problems in this query :
"SELECT IF(COUNT(*) > 0, COUNT(*), 0) AS total FROM table1 WHERE field1 = 'some_value' GROUP BY field2"
if there is no result the query is supposed to give 0 value but it gives nothing.
Can anbody help what went wrong in above query ?
thanks in advance to all of you
I am getting problems in this query :
"SELECT IF(COUNT(*) > 0, COUNT(*), 0) AS total FROM table1 WHERE field1 = 'some_value' GROUP BY field2"
if there is no result the query is supposed to give 0 value but it gives nothing.
Can anbody help what went wrong in above query ?
thanks in advance to all of you