帮助解决 ORA-00933 错误
如果我将以下语句作为 sql 脚本的一部分运行,
-- create the pivot_sales_data table
CREATE TABLE pivot_sales_data AS
SELECT *
FROM (
SELECT month, prd_type_id, amount
FROM all_sales
WHERE year = 2003
AND prd_type_id IN (1, 2, 3)
)
PIVOT (
SUM(amount) FOR month IN (1 AS JAN, 2 AS FEB, 3 AS MAR, 4 AS APR)
)
ORDER BY prd_type_id;
我会收到 ORA-00933: SQL Command 也没有正确结束的错误。我在这里缺少什么?
If I run the following statement as part of a sql script
-- create the pivot_sales_data table
CREATE TABLE pivot_sales_data AS
SELECT *
FROM (
SELECT month, prd_type_id, amount
FROM all_sales
WHERE year = 2003
AND prd_type_id IN (1, 2, 3)
)
PIVOT (
SUM(amount) FOR month IN (1 AS JAN, 2 AS FEB, 3 AS MAR, 4 AS APR)
)
ORDER BY prd_type_id;
I get the ORA-00933: SQL Command nor properly ended error. What am I missing here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的枢轴实际上不起作用。我特别在想:
In 并不是真的那样工作。您要么想要:
Your pivot doesn't really work. I'm specifically thinking about:
In doesn't really work that way. You either want: