0

Is there a limit to WHERE IN clause in MySQL?

I am talking about that comma delimited string: 41,42,39,40,37,38

How many ids I can use in that string?

DELETE FROM oc_table WHERE id IN (41,42,39,40,37,38)
Shadow
  • 33,525
  • 10
  • 51
  • 64
Jeffz
  • 2,075
  • 5
  • 36
  • 51
  • See the following answer from the duplicate question: https://stackoverflow.com/a/8808935/5389997 – Shadow May 24 '21 at 15:25
  • That said, I recommend deleting in smaller batches (no more than 10,000, prefer 1,000). The risk is expanding the rollback segment or causing long-running transactions. – Bill Karwin May 24 '21 at 15:31

0 Answers0