Skip to content

Instantly share code, notes, and snippets.

@nezuQ
Created May 14, 2014 13:55
Show Gist options
  • Save nezuQ/3deef26bb2dee8e07989 to your computer and use it in GitHub Desktop.
Save nezuQ/3deef26bb2dee8e07989 to your computer and use it in GitHub Desktop.
SQL-Tips。複数の条件のCountを一回で取得する。 ref: http://qiita.com/nezuq/items/9fbb2eee0f722269418b
SELECT
COUNT(*),
COUNT(gender = 'm' OR null),
COUNT(gender = 'f' OR null)
FROM
m_user
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment