One way to do it is to create a temporary table with records you want to keep and writing a delete statement to delete everything in the original table and not in keep table.