Hi guys!
I need a query to remove all records from my database except the
latest 100 added. I use an id as the primary key. But those records
are also often removed manually depending on some other values.
So I can not simply use : delete * from db where id < last_id - 100
because the last id could be 348 while the 100th would be 124.
I hope somone understands what I mean and can help :)
Thank you
Yang
--
I need a query to remove all records from my database except the
latest 100 added. I use an id as the primary key. But those records
are also often removed manually depending on some other values.
So I can not simply use : delete * from db where id < last_id - 100
because the last id could be 348 while the 100th would be 124.
I hope somone understands what I mean and can help :)
Thank you
Yang
--
Comment