Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有下面的查询来使用 PIVOT 按月获取员工工资,但它会抛出一个未正确结束的 SQL 命令。请验证并修复它
SELECT * FROM ( SELECT EMPID, MONTH, SALARY FROM SALARY ) PIVOT(SALARY AS SALARY FOR (MONTH) IN ('Jan','Feb','Mar')) ORDER BY EMPID;
尝试
SELECT EMPID, MONTH, SALARY FROM SALARY PIVOT(SALARY AS SALARY FOR MONTH IN ('Jan','Feb','Mar')) ORDER BY EMPID;
参考