由于水平原因,博客大部分内容摘抄于网络,如有错误或者侵权请指出,本人将尽快修改

随笔分类 -  SQL使用

摘要:1193. 每月交易 I - 力扣(LeetCode) select DATE_FORMAT(trans_date, '%Y-%m') AS month, country, count(1) as trans_count, COUNT(IF(state = 'approved', 1, NULL)) 阅读全文
posted @ 2024-07-07 16:10 小纸条 阅读(13) 评论(0) 推荐(0) 编辑
摘要:570. 至少有5名直接下属的经理 - 力扣(LeetCode) select Employee.Name as Name from ( select ManagerId as Id from Employee group by ManagerId having count(Id) >= 5 ) a 阅读全文
posted @ 2024-07-03 23:36 小纸条 阅读(11) 评论(0) 推荐(0) 编辑
摘要:求每个部门工资前三的员工 参考链接:https://leetcode-cn.com/problems/department-top-three-salaries/solution/185-bu-men-gong-zi-qian-san-gao-de-yuan-gong-by-li/ SELECT D 阅读全文
posted @ 2019-12-17 13:55 小纸条 阅读(283) 评论(0) 推荐(0) 编辑
摘要:https://leetcode-cn.com/problems/department-highest-salary/ 求组内最大值,可以不使用exist,in前面可以用的多个字段筛选。 阅读全文
posted @ 2019-12-17 11:21 小纸条 阅读(501) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示