Advertisement
dragonbs

Untitled

Oct 2nd, 2023
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. SELECT [AgeByGroup] [AgeGroup], COUNT([AgeByGroup])
  2. FROM (SELECT
  3. CASE
  4. WHEN [Age] BETWEEN 0 AND 10 THEN '[0-10]'
  5. WHEN [Age] BETWEEN 11 AND 20 THEN '[11-20]'
  6. WHEN [Age] BETWEEN 21 AND 30 THEN '[21-30]'
  7. WHEN [Age] BETWEEN 31 AND 40 THEN '[31-40]'
  8. WHEN [Age] BETWEEN 41 AND 50 THEN '[41-50]'
  9. WHEN [Age] BETWEEN 51 AND 60 THEN '[51-60]'
  10. ELSE '[61+]'
  11. END AS [AgeByGroup]
  12. FROM [WizzardDeposits]) [AgeByGroupTable]
  13. GROUP BY [AgeByGroup]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement