Skip to content

Instantly share code, notes, and snippets.

@YiLi225
Last active November 3, 2020 08:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YiLi225/cb30674a67a25a3108bbee76c445456f to your computer and use it in GitHub Desktop.
Save YiLi225/cb30674a67a25a3108bbee76c445456f to your computer and use it in GitHub Desktop.
SQL tricks
---- 1) COALESCE() to recode the NULL value to the character string MISSING
SELECT
ID_VAR,
NULL_VAR,
COALESCE(NULL_VAR, 'MISSING') AS RECODE_NULL_VAR
FROM
CURRENT_TABLE
ORDER BY ID_VAR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment