What is the best way to convert an int or null to boolean value in an SQL query, such that:
The shortest one I know for Oracle:
SELECT NVL2(nullableColumn, 1, 0) FROM someTable
NVL2(value, ifNotNull, ifNull) returns ifNotNull if the value is not null, and ifNull otherwise.
NVL2(value, ifNotNull, ifNull)
ifNotNull
value
ifNull