Skip to content

Instantly share code, notes, and snippets.

@HoffmannP
Created May 13, 2013 10:15
Show Gist options
  • Save HoffmannP/5567358 to your computer and use it in GitHub Desktop.
Save HoffmannP/5567358 to your computer and use it in GitHub Desktop.
SELECT
IF(a <=> NULL, 1, a),
IF( a IS NULL, 1, a ),
IF( a IS NOT NULL, a, 1 ),
IF( ISNULL(a), 1, a ),
IF( !ISNULL(a), a, 1 ),
IF( !!ISNULL(a), 1, a ),
IFNULL( a, 1 )
FROM
(SELECT 1 as a) as tmp
GROUP BY
a WITH ROLLUP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment