I am using sql server 2000.

I have a query like this to get 7 records:
Code:
select max(id),db_num from xPTS group by db_num
I need run another query to delete all records in table XPTS except this 7 records.

Can anyone help? Thanks.