试了很久 实际上在sqllite在线的编写的环境下测试过后,确实可以得到正确的答案,所以那些想试验 table a table b 的童鞋可以注意一下,可能只是运行环境原因造成报错的~

上代码:
select s1.emp_no, count(s1.emp_no) as t
from salaries s1 left join salaries s2
on s1.emp_no = s2.emp_no and s1.to_date = s2.from_date
where s1.salary < s2.salary
group by s1.emp_no
having t>15