Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d8f22af

Browse files
Update SQL Code File.sql
1 parent a9535d9 commit d8f22af

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

‎SQL Code File.sql‎

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,6 @@ GROUP BY t1.YEAR, t2.ttl;
359359
------------------------------------------------------------------------------------------
360360
------------------------------------------------------------------------------------------
361361

362-
363362
/*
364363
365364
----------Q.5----------
@@ -404,11 +403,10 @@ PIVOT
404403
IN ([1], [2], [3], [4], [5], [6], [7])
405404

406405
) AS PivotTable
406+
407407
------------------------------------------------------------------------------------------
408408
------------------------------------------------------------------------------------------
409409

410-
411-
412410
/*
413411
414412
----------Q.6----------
@@ -477,3 +475,26 @@ ON TEMP.YEAR =B.YEAR
477475
WHERE TEMP.Rank <=3
478476
GROUP BY TEMP.YEAR,B.TTQ1
479477
ORDER BY TEMP.YEAR;
478+
479+
------------------------------------------------------------------------------------------
480+
------------------------------------------------------------------------------------------
481+
482+
/*
483+
484+
----------Q.7----------
485+
486+
Leetcode Problem 362
487+
488+
*/
489+
490+
SELECT '[0-5>' AS bin, SUM duration/60 < 5) AS 'total'
491+
FROM Sessions
492+
UNION
493+
SELECT '[5-103' AS bin, SUM duration/60 > 5 AND duration/60 < 10) AS 'total'
494+
FROM Sessions
495+
UNION
496+
SELECT ' [10-15>' AS bin, SUM duration/60 > 10 AND duration/60 < 15) AS 'total'
497+
FROM Sessions
498+
UNION
499+
SELECT '15 or more' AS bin, SUM duration/60 > 15) AS 'total'
500+
FROM Sessions;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /