sql count value if conditions met code example Example: sql count if COUNT(CASE WHEN <condition> THEN 1 END)