Puoi usare row_number()
:
delete
from (select nm.*,
row_number() over (order by id desc) as seq
from nametable nm
) nm
where seq > 500;
In questo modo, cancellerà tutti i record iniziali da 501
.
Puoi usare row_number()
:
delete
from (select nm.*,
row_number() over (order by id desc) as seq
from nametable nm
) nm
where seq > 500;
In questo modo, cancellerà tutti i record iniziali da 501
.