I used a query to delete duplicate rows in sybase.
It worked; However when I used similar query for practice on oracle and it did not work;
Please advise
Sybase query that worked:
--delete all the duplicate rdb_id where row_id is greater than the min row_id
delete ratings_xref..xref_ratg_obj_id
from ratings_xref..xref_ratg_obj_id a, ratings_xref..xref_ratg_obj_id b
where a.rdb_id = b.rdb_id
and a.row_id > b.row_id
go
However, the below code did not work in oracle :
delete dup6
from dup6 d6,dup6 d61
where d6.rowid>d61.rowid
and d6.i=d6i.i;
Same with update :
Below sybase code works :
update ratings_xref..xref_ratg_obj_id
set a.last_chg_usr=suser_name(),
a.last_chg_dt=getdate()
from ratings_xref..xref_ratg_obj_id a, ratings_xref..xref_ratg_obj_id b
where a.rdb_id = b.rdb_id
and a.row_id > b.row_id
Whereas the oracle code does not work
update dupli
set bb.chg_dt=sysdate-360
from dupli bb,dupli b
where bb.i=b.i
and bb.rowid>b.rowid;
The error received while deleting using the oracle query was :
Error report -
SQL Error: ORA-00933: SQL command not properly ended
00933. 00000 - "SQL command not properly ended"