添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

For appeals, questions and feedback about Oracle Forums, please email [email protected] . Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

ORA-00920: - Invalid relational operator error

User_3YG1K Apr 14 2022

Hi , I have code like below :
Create Table a_2 ( c_id Number, c_name Varchar2(30));
Insert Into a_2 Values(1,'aaaaa');
Insert Into a_2 Values(2,'bbbb');
Insert Into a_2 Values(3,'cccc');
Insert Into a_2 Values(4,'dddd');
commit;
Select * From a_2;
Insert Into a_2 Values(4,'dddd');
------> now the purpose is to Delete duplicate records
Select Max(Rowid), c_id From a_2 Group By c_id Order By c_id Asc;
using the above query as subquery in DELETE using ROWID,
Delete From a_2
Where (Rowid,c_id) Not In (Select Max(Rowid),c_id From a_2
Group By c_id order By c_id Asc);
Problem is ----> when i execute the beloew query alone,
Select Max(Rowid),c_id From a_2 Group By c_id Order By c_id Asc , it is fine, there is no error bcoz of adding ASC at the end.
------> but , if i put same query in DELETE , i get the error, ''ORA-00920: invalid relational operator"
May i know where i am going wrong ?

Thanks for the reply.