hi gems..good afternoon..
I read that the COUNT() function always returns 0 (zero) if there is no matching rows in the table.
The following code returns the 0 as expected:
SELECT COUNT(1) FROM book_table
WHERE client_id = 10009
AND book_id = 5465465
AND book_sub_id = 'gfdf'
AND amount = 78686
But when I used the GROUP BY clause with the query, then it returned nothing:
SELECT COUNT(1) FROM book_table
WHERE client_id = 10009
AND book_id = 5465465
AND book_sub_id = 'gfdf'
AND amount = 78686
group by client_id,book_id,book_sub_id,amount
Why this is happening..please suggest...