I want to query over two columns as 2-tuples , where one can be null.
example :
+-------------------------+
| first | last |
+-------------------------+
| Homer | NULL |
| Marge | Simpson |
+-------------------------+
Something like:
Select * from cartoons where (first, last ) in ((Homer ,NULL ), ( Marge ,Simpson) ) ;
(Which should retrieve both Homer's and Marge's rows)
I am using the following query for test:
select ('Homer', null) in (('Homer', null));
which returns null.
Reference to related questions :
SQL version : 5.7.12