Created
May 31, 2011 10:30
-
-
Save jaygooby/1000280 to your computer and use it in GitHub Desktop.
Case statement to increment count()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select lea, SUM(CASE WHEN school_type like '%primary%' THEN 1 ELSE 0 END) as `primary`, SUM(CASE WHEN school_type like '%secondary%' THEN 1 ELSE 0 END) as `secondary` from schools group by lea |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment