Leetcode SQL
文章平均质量分 90
itslifeng
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Exist和in的区别
Exist select book_key from book where exists (select book_key from sales); In select book_key from book where book_key in (select book_key from sales); The EXISTS clause is much faster than IN when the subquery results is very large.原创 2020-09-22 01:29:37 · 286 阅读 · 0 评论 -
Leetcode - SQL 1158 -Case When使用
这里写目录标题题目思路 题目 Write an SQL query to find for each user, the join date and the number of orders they made as a buyer in 2019. The query result format is in the following example: Users table: ±--------±-----------±---------------+ | user_id | join_date |原创 2020-09-22 00:45:44 · 223 阅读 · 0 评论 -
LeetCode - SQL 603 - 取该列连续的三位数(LEAD和 LAG的使用)
这里写目录标题题目思路思路2 题目 Several friends at a cinema ticket office would like to reserve consecutive available seats. Can you help to query all the consecutive available seats order by the seat_id using the following cinema table? seat_id free 1 1 2 0原创 2020-09-20 04:49:21 · 434 阅读 · 0 评论 -
LeetCode - SQL 597 -两个group bys 代替 distinct
目录题目:思路: 题目: In social network like Facebook or Twitter, people send friend requests and accept others’ requests as well. Now given two tables as below: Table: friend_request sender_id send_to_id request_date 1 2 2016_06-01 1 3 2016_06-01 1 4 2原创 2020-09-19 05:13:06 · 211 阅读 · 0 评论
分享