sumover mysql_mysql之 sum() over(partition by)
SELECT empno,ename,sal,IF(@deptno = deptno, @sal := @sal, @sal := s_sal) AS s_sal,@deptno := deptnoFROM(SELECT empno,ename,sal,IF(@deptno = deptno, @sal := @sal + sal, @sal := sal) AS s_sal,@deptno :=...