Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Seldomly Used SQL: The Bool Aggregate Functions. Parent comment
So:
CASE WHEN SUM(express_delivered) = 0 THEN 0 ELSE 1 END AS ever_been_express_delivered
becomes:
IIF(SUM(express_delivered) = 0, 0, 1) AS ever_been_express_delivered
https://msdn.microsoft.com/en-GB/library/hh213574.aspx
There are no comments on this comment yet.
So:
CASE WHEN SUM(express_delivered) = 0 THEN 0 ELSE 1 END AS ever_been_express_delivered
becomes:
IIF(SUM(express_delivered) = 0, 0, 1) AS ever_been_express_delivered
https://msdn.microsoft.com/en-GB/library/hh213574.aspx