Advertisement
horozov86

12. Age Group - OK

Sep 30th, 2023
958
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. SELECT
  2.     CASE
  3.         WHEN age BETWEEN 0 AND 10 THEN '[0-10]'
  4.         WHEN age BETWEEN 11 AND 20 THEN '[11-20]'
  5.         WHEN age BETWEEN 21 AND 30 THEN '[21-30]'
  6.         WHEN age BETWEEN 31 AND 40 THEN '[31-40]'
  7.         WHEN age BETWEEN 41 AND 50 THEN '[41-50]'
  8.         WHEN age BETWEEN 51 AND 60 THEN '[51-60]'
  9.         ELSE '[61+]'
  10.     END AS age_group,
  11.     COUNT(*) AS count
  12. FROM
  13.     wizard_deposits
  14. GROUP BY
  15.     age_group
  16. ORDER BY
  17.     age_group;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement