I'm looking for a single SQL query to run on an oracle table that will retain n number of records in a table and delete the rest
I tried the following
delete from myTable where pk not in
(SELECT pk FROM myTable where rownum <5 order by created DESC)
But it appears that I cannot have order by
in the nested select.
Any help appreciated