Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select [Name]
- ,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 [Name]
- ,[Duration]
- ,[Part of the Day]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement