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