I need to delete rows 1-150934 from my database.
Unfortunately, the ID's in this section are not 1-150934 (as they are shuffled) so I cannot match on that. The only thing I can go on is that I need to delete the first 150934 rows that appear in my table Listing_Summary.
Is this possible?
I have never ran a delete statement before. I looked on here and did not find a Where statement that would match was I was trying to do.
LIMIT to limit the number of rows that are deleted:
DELETE [LOW_PRIORITY] [QUICK] [IGNORE] FROM tbl_name [PARTITION (partition_name,...)] [WHERE where_condition] [ORDER BY ...] [LIMIT row_count]
From MySQL reference manual:
LIMIT row_countclause for
DELETEspecifies the maximum number of rows to be deleted.
Edit: Do not use this command as-is, but you are going to want to do something similar to this:
DELETE FROM `Listing_Summary` WHERE ... ORDER BY ... LIMIT 150934
You will need to update the
... in the WHERE clause and ORDER BY clause based on your particular use-case.