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.