ORA-00933:SQL命令未在PIVOT函数中正确结束

时间:2013-09-05 11:14:21

标签: sql oracle

我有以下查询通过使用PIVOT按月获得员工薪水,但它会抛出SQL命令未正确结束。请验证并修复它

SELECT *
FROM (
    SELECT EMPID, MONTH, SALARY
    FROM SALARY
) PIVOT(SALARY AS SALARY FOR (MONTH) IN ('Jan','Feb','Mar'))
ORDER BY EMPID;

提前致谢。

1 个答案:

答案 0 :(得分:0)

尝试

SELECT EMPID, MONTH, SALARY
   FROM SALARY
   PIVOT(SALARY AS SALARY FOR MONTH IN ('Jan','Feb','Mar'))
   ORDER BY EMPID;

Reference