Question from interview:
select count(1) from tablename where column=column
What result does this request return and why?
This returns the number of rows where column
is not null, because NULL = NULL
yields UNKNOWN
which evaluates to false
in the condition. For all other values column = column
is true.