audit_table might contain repeated userId.
We have following SQL query
SELECT userId FROM audit_table
GROUP BY userId
HAVING MIN(updatedDate) > ?;
updatedDate field might be null and for case when all rows in audit_table for concrete userId contains only nulls I don't see these rows but I want.
Is there way to acheve it ?
One method is an explicit comparison:
Another method is to count the
updatedDatesthat are less than?orNULL: