Skip to content

Instantly share code, notes, and snippets.

@weilu
Created October 16, 2013 02:09
Show Gist options
  • Save weilu/7001592 to your computer and use it in GitHub Desktop.
Save weilu/7001592 to your computer and use it in GitHub Desktop.
PostgreSQL NULL comparison
=# select (1!=1);
?column?
----------
f
(1 row)
=# select (1=1);
?column?
----------
t
(1 row)
=# select (NULL=NULL);
?column?
----------
(1 row)
=# select (NULL!=NULL);
?column?
----------
(1 row)
=# select (NULL is NOT NULL);
?column?
----------
f
(1 row)
=# select (NULL is NULL);
?column?
----------
t
(1 row)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment