Consider the query (it runs on both Oracle and MySQL)
UPDATE table1
SET something_id = CASE
WHEN table1_id = 1446 THEN 423
WHEN table1_id = 2372 THEN 426
WHEN table1_id = 2402 THEN 428
WHEN table1_id = 2637 THEN 429
WHEN table1_id = 2859 THEN 430
WHEN table1_id = 3659 THEN 433
END
WHERE table1_id IN (1446,2372,2402,2637,2859,3659)
This query can get quite large, so I was wondering what is the limit on the number of conditions (WHEN, THEN statements) a single query can hold. Is there a way around it?
For example:
I know that the max number of values that can be passed to IN
is 1000 and to overcome this we can do
`WHERE TABLE1_ID IN ([1000 values]) OR TABLE1_ID IN ([more values])`