SELECT foo, CASE WHEN MAX(CASE WHEN bar IS NULL THEN 0 ELSE bar END)=1 THEN 1 ELSE 0 END as bar FROM baz GROUP BY foo HAVING qux > 42
No comments:
Post a Comment