Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

delete records based on percentage

user9229402Mar 28 2018 — edited Apr 1 2018

Hi i have huge records in tables. i need to delete/purge records based on record counts. Example:- if table contains 100 records. i need to delete 60% records( or 40% records to keep). Delete the top records or older records based on created date. there are so many tables like this. Is there any bulk delete option based on percentage or ntile methods? please suggest how can we achieve?

im preparing an script which has two statements. one for record count and percentage. second is delete statement where rownum < first statement output. Any better solution?

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 29 2018
Added on Mar 28 2018
12 comments
934 views