Created
December 7, 2021 03:06
-
-
Save ddrscott/01917c6433c18bc6f7c278161957734a to your computer and use it in GitHub Desktop.
Simple non-repeating pairs of numbers in all combinations
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
WITH inputs AS ( | |
SELECT | |
row_number() over () as idx, | |
letter | |
FROM unnest(ARRAY['a', 'b', 'c', 'd']) letters(letter) | |
) | |
SELECT | |
a.letter, | |
b.letter | |
FROM inputs a, inputs b | |
WHERE a.idx < b.idx; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It works.