Skip to content

Instantly share code, notes, and snippets.

@Tattoo
Created November 1, 2018 15:10
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 Tattoo/5b75ea42a971b05759cf09176b535c70 to your computer and use it in GitHub Desktop.
Save Tattoo/5b75ea42a971b05759cf09176b535c70 to your computer and use it in GitHub Desktop.
Self-validating SQL queries for interactive
-- https://stackoverflow.com/a/754570
SELECT CONCAT(
'Sufficient and sufficiently varied month_value test data: ',
CASE WHEN (
SELECT COUNT(DISTINCT y, m) FROM month_value
) > 10
AND (
SELECT COUNT(DISTINCT y) FROM month_value
) > 3
THEN 'passed'
ELSE 'failed'
END
)
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment