I try to do the the following query with mysql (Should add more conditions, but simplified it for the question, so the sub-query sometimes return null and sometimes return value, this is just for making the query shorter for the question):
SELECT COUNT(*)
FROM table
WHERE date = (SELECT MAX(date) FROM table)
My problem is that if the sub-query return null, my result will be 0, which is not the desired result.
Since I can't do IS instead of =, I'm wondering if there is a simple solution.