用group by将每个员工的数据分成单独的组,用having进行组内筛选
select emp_no, count(*) as t from salaries
group by emp_no
having t > 15
#having用于对聚合函数的结果进行限制,比如count(),sum(),where只能对表中数据进行限制
#having在没有group by的情况下和where功能一样,比如
select emp_no, salary from salaries
having salary > 80000