我有以下查询通过使用PIVOT按月获得员工薪水,但它会抛出SQL命令未正确结束。请验证并修复它
SELECT *
FROM (
SELECT EMPID, MONTH, SALARY
FROM SALARY
) PIVOT(SALARY AS SALARY FOR (MONTH) IN ('Jan','Feb','Mar'))
ORDER BY EMPID;
提前致谢。
答案 0 :(得分:0)
尝试
SELECT EMPID, MONTH, SALARY
FROM SALARY
PIVOT(SALARY AS SALARY FOR MONTH IN ('Jan','Feb','Mar'))
ORDER BY EMPID;