Created
September 8, 2016 09:33
-
-
Save benmmurphy/eadd9edf5e77e7c65e868891d40667ac to your computer and use it in GitHub Desktop.
SQL Making Sense
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
postgres=# select NULL + 4; | |
?column? | |
---------- | |
(1 row) | |
postgres=# select SUM(foo) from (select NULL::integer as foo UNION all select 1) x; | |
sum | |
----- | |
1 | |
(1 row) | |
postgres=# select SUM(foo) from (select NULL::integer as foo UNION all select 1) x where foo = 5; | |
sum | |
----- | |
(1 row) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment