Skip to content

Commit bfeb3ab

Browse files
committed
Update README.md
1 parent 074d187 commit bfeb3ab

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,4 +379,27 @@ WHERE primary_flag = 'Y' OR employee_id IN
379379
GROUP BY employee_id
380380
HAVING COUNT(department_id) = 1
381381
)
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
382405
```

0 commit comments

Comments
 (0)