Skip to content

Instantly share code, notes, and snippets.

@doryokujin
Created April 23, 2015 05:25
Show Gist options
  • Save doryokujin/ed09cd3b6a427221bb0a to your computer and use it in GitHub Desktop.
Save doryokujin/ed09cd3b6a427221bb0a to your computer and use it in GitHub Desktop.
SELECT n1.symbol,n2.symbol, n1.number, n2.number
FROM
(
SELECT number, symbol
FROM trump_part
WHERE symbol!='joker'
) n1
JOIN
(
SELECT number, symbol
FROM trump_part
WHERE symbol!='joker'
) n2
ON n1.symbol = n2.symbol
HAVING n1.number < n2.number
ORDER BY n1.symbol, n2.symbol, n1.number, n2.number
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment