分组和组内计数
查找薪水涨幅超过15次的员工号emp_no以及其对应的涨幅次数t
http://www.nowcoder.com/questionTerminal/6d4a4cff1d58495182f536c548fee1ae
1. 分析
分组,组内计数 count(emp_no) As t > 15
2. 代码
SELECT emp_no, COUNT(emp_no) AS t FROM salaries GROUP BY emp_no HAVING t > 15;
查找薪水涨幅超过15次的员工号emp_no以及其对应的涨幅次数t
http://www.nowcoder.com/questionTerminal/6d4a4cff1d58495182f536c548fee1ae
分组,组内计数 count(emp_no) As t > 15
SELECT emp_no, COUNT(emp_no) AS t FROM salaries GROUP BY emp_no HAVING t > 15;
相关推荐