Code
SELECT A.日期, A.部门ID, A.岗位ID, A.员工ID, A.薪资金额 AS 最后薪资, B.薪资金额 AS 之前薪资, Nz(A.薪资金额) - Nz(B.薪资金额) AS 变动
FROM 工资变动 AS A INNER JOIN 工资变动 AS B ON (A.岗位ID = B.岗位ID) AND (A.部门ID = B.部门ID) AND (A.员工ID = B.员工ID) AND (A.日期 > B.日期)
WHERE A.日期 IN (SELECT Max(日期) FROM 工资变动 WHERE 员工ID = A.员工ID)
ORDER BY A.日期, A.部门ID, A.岗位ID, A.员工ID