LeetCode(数据库)- 活动参与者

简介: LeetCode(数据库)- 活动参与者

题目链接:点击打开链接

题目大意:略。

解题思路:略。

AC 代码

--解决方案(1)
selectactivityfromFriendsgroupbyactivityhavingcount(id) != (selectcount(id) fromFriendsgroupbyactivityorderbycount(id) desclimit1)
andcount(id) != (selectcount(id) fromFriendsgroupbyactivityorderbycount(id) limit1)
--解决方案(2)
WITHt1AS(SELECTactivity, COUNT(*) cntFROMFriendsGROUPBYactivity),
t2AS(SELECTactivity, DENSE_RANK() OVER(ORDERBYcnt) rkFROMt1),
t3AS(SELECTMAX(rk) maxnFROMt2)
SELECTnameactivityFROMActivitiesWHEREnameIN (SELECTactivityFROMt2WHERErk>1ANDrk< (SELECT*FROMt3))
目录
相关文章
|
数据库
LeetCode(数据库)- 活跃用户
LeetCode(数据库)- 活跃用户
77 0
LeetCode(数据库)- 活跃用户
|
数据库
LeetCode(数据库)- 过去30天的用户活动 II
LeetCode(数据库)- 过去30天的用户活动 II
83 0
|
数据库
LeetCode(数据库)- 获取最近第二次的活动
LeetCode(数据库)- 获取最近第二次的活动
100 0
|
数据库
LeetCode(数据库)- 每天的最大交易
LeetCode(数据库)- 每天的最大交易
92 0
|
数据库
LeetCode(数据库)- 每月交易II
LeetCode(数据库)- 每月交易II
96 0
|
数据库
LeetCode(数据库)- 1303. 求团队人数
LeetCode(数据库)- 1303. 求团队人数
104 0
|
数据库
LeetCode(数据库)- 进店却未进行过交易的顾客
LeetCode(数据库)- 进店却未进行过交易的顾客
94 0
|
数据库
LeetCode(数据库)- 富有客户的数量
LeetCode(数据库)- 富有客户的数量
83 0
|
数据库
LeetCode(数据库)- 查询活跃业务
LeetCode(数据库)- 查询活跃业务
105 0
|
数据库
LeetCode(数据库)- 学生们参加各科测试的次数
LeetCode(数据库)- 学生们参加各科测试的次数
96 0