WindFell

Show All Games with Duration and Part of the Day

Jan 23rd, 2019
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.41 KB | None | 0 0
  1. SELECT [Name] AS 'Game',
  2.     CASE
  3.         WHEN DATEPART(HOUR, [START]) BETWEEN 0 AND 11 THEN 'Morning'
  4.         WHEN DATEPART(HOUR, [START]) BETWEEN 12 AND 17 THEN 'Afternoon'
  5.         ELSE 'Evening'
  6.     END AS 'Part of the Day',
  7.     CASE
  8.         WHEN Duration <= 3 THEN 'Extra Short'
  9.         WHEN Duration BETWEEN 4 AND 6 THEN 'Short'
  10.         WHEN Duration > 6 THEN 'Long'
  11.         ELSE 'Extra Long'
  12.     END AS 'Duration'
  13. FROM GAMES
  14.     ORDER BY [Name], Duration
Advertisement
Add Comment
Please, Sign In to add comment