In some SQL products, you can simplify the syntax inside CASE by removing a few AND and OR in a simple IN :
UPDATE Products SET Active = CASE WHEN (Id_A, Id_B, Id_C) IN ( (1, 1, 5), (1, 2, 1), (5, 8, 3) ... ) THEN 1 ELSE 0 END ;
Another thing to consider is that if there are a lot of rows in the table (for example, millions or billions), and only a small percentage is set to Active=1 , it will probably be more efficient to update 2 statements, similar to what you were from the very beginning, if you have an index on (Active) (or a partial index on (Active=1) ):
UPDATE Products SET Active = 0 WHERE Active = 1 ; UPDATE Products SET Active = 1 WHERE ... ;
source share