0

I have a table with object varchar and score int. I would like to DELETE all except the top 100 scoring items. Is this possible?

1 Answer 1

3

mysql's delete support both order by and limit so you should be find doing following:

select count(*) from t;
delete from t order by score asc limit resultFromPrevious-100;

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .