Софтуерно Инженерство
Loading...
+ Нов въпрос
AleksPeshev avatar AleksPeshev 4 Точки

Problem 15. Show All Games with Duration and Part of the Day %HELP%

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'
WHEN DATEPART(HOUR, Start) >= 18 
AND DATEPART(HOUR, Start) < 24 THEN 'Evening'
END AS [Part of the day],
CASE WHEN Duration <= 3 THEN 'Extra Short'
WHEN Duration >= 4 AND Duration <=6 THEN 'Short'
WHEN Duration > 6 THEN 'Long'
ELSE 'Without duration'
END AS Duration
FROM Games ORDER BY Name,Duration,[Part of the day]

Я УДАРЕТЕ ЕДНО РАМО,ЧЕ JUDGE НЕ ГО ОДОБРЯВА.yes
 

Тагове:
0
Databases Basics
Wencii avatar Wencii 89 Точки

ELSE 'Without duration' - това не трябва ли да е ELSE 'Extra Long'?

 

0
29/01/2017 23:17:37