select emp_no,count(salary) as t
from salaries
group by emp_no
having t>15

使用聚合函数和分组判断就好了