File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -379,4 +379,27 @@ WHERE primary_flag = 'Y' OR employee_id IN
379
379
GROUP BY employee_id
380
380
HAVING COUNT (department_id) = 1
381
381
)
382
+ ```
383
+
384
+ [ 610. Triangle Judgement] ( https://leetcode.com/problems/triangle-judgement/ )
385
+
386
+ ``` sql
387
+ SELECT x, y, z,
388
+ CASE WHEN x + y > z AND x + z > y AND y + z > x THEN ' Yes'
389
+ ELSE ' No' END AS triangle
390
+ FROM Triangle
391
+ ```
392
+
393
+ [ 180. Consecutive Numbers
394
+ ] ( https://leetcode.com/problems/consecutive-numbers/ )
395
+ ``` sql
396
+ WITH cte AS (
397
+ SELECT id, num,
398
+ LEAD(num) OVER (ORDER BY id) AS next,
399
+ LAG(num) OVER (ORDER BY id) AS prev
400
+ FROM Logs
401
+ )
402
+ SELECT DISTINCT (num) AS ConsecutiveNums
403
+ FROM cte
404
+ WHERE num = next AND num = prev
382
405
```
You can’t perform that action at this time.
0 commit comments