I have a quick question. What is the best way to handle the situation where there may be NULL values in the list of values used in a NOT IN statement? Here is an example:
Code: Select all
dbadmin=> select * from names;
name
-------
Laura
(2 rows)
dbadmin=> select name from names where 'Luke' not in (select name from names);
name
------
(0 rows)
Code: Select all
dbadmin=> delete from names where name is null;
OUTPUT
--------
1
(1 row)
dbadmin=> select name from names where 'Luke' not in (select name from names);
name
-------
Laura
(1 row)
Thank you!