2
我得到ORA-00904'c'無效標識符錯誤。這個別名有什麼問題?ORA-00904無效標識符錯誤
select NO, count(JOINT_NO) as c
from JOINT
WHERE HOLDER = 'Y' AND JOINT.c > 1
GROUP BY NO;
我得到ORA-00904'c'無效標識符錯誤。這個別名有什麼問題?ORA-00904無效標識符錯誤
select NO, count(JOINT_NO) as c
from JOINT
WHERE HOLDER = 'Y' AND JOINT.c > 1
GROUP BY NO;
我想你想獲取其計數> 1,所以你不能在同一查詢WHERE
子句中使用Indentifier C
這些記錄。
select NO, count(JOINT_NO) as c
from JOINT
WHERE HOLDER = 'Y'
GROUP BY NO
HAVING COUNT(JOINT_NO)>1;
有表JOINT
不存在列c
,導致你所得到的錯誤消息。
更改您的查詢是這樣的:
select NO, count(JOINT_NO) as c
from JOINT
WHERE HOLDER = 'Y'
GROUP BY NO
HAVING count(JOINT_NO) > 1;