Skip to content

Instantly share code, notes, and snippets.

@tsh-code
Created March 26, 2019 11:49
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tsh-code/e46c278adc2082d265fd0bfb55e029b2 to your computer and use it in GitHub Desktop.
WITH colors(color)
AS (
SELECT *
FROM unnest(array['red', 'black', 'white'])
), sizes(size)
AS (
SELECT *
FROM unnest(array['S', 'M', 'L', 'XL'])
), shoes(type)
AS (
SELECT *
FROM unnest(array['heels', 'uggs', 'boots', 'wedges'])
)
SELECT concat_ws(', ', colors.color,sizes.size,shoes.type)
FROM colors
CROSS JOIN sizes
CROSS JOIN shoes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment