-
-
Save binki/b8e0bd5d1857ef062459 to your computer and use it in GitHub Desktop.
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
SET ANSI_NULLS ON | |
SELECT a, b, CASE WHEN a!>b THEN 1 ELSE 0 END "a!>b", CASE WHEN a<=b THEN 1 ELSE 0 END "a<=b" FROM (SELECT 0 a, 0 b UNION SELECT 0, 1 UNION SELECT 0, NULL UNION SELECT 1, 0 UNION SELECT 1, 1 UNION SELECT 1, NULL UNION SELECT NULL, 0 UNION SELECT NULL, 1 UNION SELECT NULL, NULL) _; | |
SET ANSI_NULLS OFF | |
SELECT a, b, CASE WHEN a!>b THEN 1 ELSE 0 END "a!>b", CASE WHEN a<=b THEN 1 ELSE 0 END "a<=b" FROM (SELECT 0 a, 0 b UNION SELECT 0, 1 UNION SELECT 0, NULL UNION SELECT 1, 0 UNION SELECT 1, 1 UNION SELECT 1, NULL UNION SELECT NULL, 0 UNION SELECT NULL, 1 UNION SELECT NULL, NULL) _; |
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
a b a!>b a<=b | |
----------- ----------- ----------- ----------- | |
NULL NULL 0 0 | |
NULL 0 0 0 | |
NULL 1 0 0 | |
0 NULL 0 0 | |
0 0 1 1 | |
0 1 1 1 | |
1 NULL 0 0 | |
1 0 0 0 | |
1 1 1 1 | |
(9 row(s) affected) | |
a b a!>b a<=b | |
----------- ----------- ----------- ----------- | |
NULL NULL 0 0 | |
NULL 0 0 0 | |
NULL 1 0 0 | |
0 NULL 0 0 | |
0 0 1 1 | |
0 1 1 1 | |
1 NULL 0 0 | |
1 0 0 0 | |
1 1 1 1 | |
(9 row(s) affected) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment