I\'d like to convert a query such as:
SELECT BoolA, BoolB, BoolC, BoolD FROM MyTable;
Into a bitmask, where the bits are defined by the val
I came up with this approach as well. It's the most concise I could find short of writing a custom function. I'll accept this answer unless anyone has anything more clever.
SELECT (BoolD::int << 0) + (BoolC::int << 1) + (BoolB::int << 2) + (BoolA::int << 3) from MyTable;