Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- Name AS [Game],
- CASE
- WHEN DATEPART(HOUR, START) BETWEEN 0 AND 11 THEN 'Morning'
- WHEN DATEPART(HOUR, START) BETWEEN 12 AND 17 THEN 'Afternoon'
- WHEN DATEPART(HOUR, START) BETWEEN 18 AND 23 THEN 'Evening'
- END AS [Part OF the DAY],
- CASE
- WHEN Duration <= 3 THEN 'Extra Short'
- WHEN Duration BETWEEN 4 AND 6 THEN 'Short'
- WHEN Duration > 6 THEN 'Long'
- WHEN Duration IS NULL THEN 'Extra Long'
- END AS [Duration]
- FROM Games
- ORDER BY [Game], [Duration], [Part OF the DAY]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement