Skip to content

Instantly share code, notes, and snippets.

@YiLi225
Created November 29, 2020 17:16
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 YiLi225/eceb44c670f5d6ffa9384220285f1351 to your computer and use it in GitHub Desktop.
Save YiLi225/eceb44c670f5d6ffa9384220285f1351 to your computer and use it in GitHub Desktop.
/** 5. NULL values **/
SELECT
COUNT(*) AS total_cnt,
COUNT(CASE WHEN location_var = 'California' THEN id_var END) AS california_CNT,
COUNT(CASE WHEN location_var <> 'California' THEN id_var END) AS non_california_CNT
FROM
userlogin
WHERE id_var = '0155'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment