随笔分类 - 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))
阅读全文
摘要:570. 至少有5名直接下属的经理 - 力扣(LeetCode) select Employee.Name as Name from ( select ManagerId as Id from Employee group by ManagerId having count(Id) >= 5 ) a
阅读全文
摘要:求每个部门工资前三的员工 参考链接: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
阅读全文
摘要:https://leetcode-cn.com/problems/department-highest-salary/ 求组内最大值,可以不使用exist,in前面可以用的多个字段筛选。
阅读全文