Skip to content

Instantly share code, notes, and snippets.

@jcarouth
Last active February 18, 2016 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jcarouth/a5f69d0185f90fb7966a to your computer and use it in GitHub Desktop.
Save jcarouth/a5f69d0185f90fb7966a to your computer and use it in GitHub Desktop.
SELECT GROUP_CONCAT(LETTERS_YO SEPARATOR '') as ME
FROM (
SELECT DISTINCT t1.LETTERS_YO FROM (SELECT 'A' AS LETTERS_YO UNION SELECT 'B' UNION SELECT 'D') as t1
INNER JOIN
(SELECT * FROM(SELECT 'A' UNION SELECT 'B' UNION SELECT 'C' UNION SELECT 'D') as t2) as t3
ORDER BY LETTERS_YO DESC
) AS t4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment