My code below to delete duplicate entries
with mytable as
(
select a.*,
row_number() over(partition by emp_id order by emp_id) as Row_number
from employee_Details2 a
)
delete from mytable
where Row_number=2;
Error:
*ORA-00928: missing SELECT keyword
00928. 00000 - "missing SELECT keyword"
*Cause:
*Action:
Error at Line: 43 Column: 1*
You can't delete from a CTE.
If it is about deleting from
employee_details2
, then see if this helps:If you want to delete rows using "row number" (as you put it), well - yes, you can do that, but what I suggested originally is simpler and better.