2 ms·
You need one more output column. The specifics will vary by RDBMS because SQL isn't that standard. The most portable thing would be to do this: SELECT x.a,
by cryptonector 4y ago
You need one more output column. The specifics will vary by RDBMS because SQL isn't that standard. The most portable thing would be to do this:
SELECT x.a, y.a IS NOT NULL, y.b
FROM x
LEFT JOIN y ON x.a = y.a;
assuming y.a is a NOT NULL column, or a PRIMARY KEY column, since PKs are supposed to be non-nullable.
In PG you could:
SELECT x.a, y IS DISTINCT FROM NULL, y.b
FROM x
LEFT JOIN y ON x.a = y.a;