对UNPIVOT列运行基本查询到行并获取“无效标识符”错误。我的代码中是否有拼写错误?
Oracle 11G
select
1 c1, 2 c2, 3 c3
FROM
dual t
UNPIVOT
INCLUDE NULLS (
VALUE
FOR
COL
IN
(
c1,c2,c3
));
错误:
ORA-00904: "C3": invalid identifier
00904. 00000 - "%s: invalid identifier"
*Cause:
*Action:
Error at Line: 533 Column: 13
答案 0 :(得分:2)
请重新构建您的查询...
with t as (select
1 c1, 2 c2, 3 c3
FROM
dual)
select * from t
UNPIVOT
INCLUDE NULLS (
VALUE
FOR
COL
IN
(
c1,c2,c3
));