Skip to content

Instantly share code, notes, and snippets.

@prettydiff
Created October 25, 2022 20:43
Show Gist options
  • Save prettydiff/e0b714147ea028cd468b9587d6ba46dd to your computer and use it in GitHub Desktop.
Save prettydiff/e0b714147ea028cd468b9587d6ba46dd to your computer and use it in GitHub Desktop.
IF customer = 'A' THEN
SET headers = 'header 1', 'header 2', 'header 3', ''
SET summary = 'item 1', 'item 2', 'item 3', ''
ELSE
SET headers = 'header aa', 'header dd', 'header ff', 'header ad'
SET summary = data_x, data_y, data_a, data_b
END IF
SELECT
headers
UNION
SELECT
summary
UNION
SELECT
'', '', '', ''
UNION
SELECT
# some big giant join here
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment