Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT [AgeByGroup] [AgeGroup], COUNT([AgeByGroup])
- FROM (SELECT
- CASE
- WHEN [Age] BETWEEN 0 AND 10 THEN '[0-10]'
- WHEN [Age] BETWEEN 11 AND 20 THEN '[11-20]'
- WHEN [Age] BETWEEN 21 AND 30 THEN '[21-30]'
- WHEN [Age] BETWEEN 31 AND 40 THEN '[31-40]'
- WHEN [Age] BETWEEN 41 AND 50 THEN '[41-50]'
- WHEN [Age] BETWEEN 51 AND 60 THEN '[51-60]'
- ELSE '[61+]'
- END AS [AgeByGroup]
- FROM [WizzardDeposits]) [AgeByGroupTable]
- GROUP BY [AgeByGroup]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement