Skip to content
Advertisement

multidimensional “WHERE IN” condition?

As is well-known, we can simplify

as follows:

Is there a similar shortcut possible for “multidimensional” conditions as in the following:

in a form resembling something like this

?

I would be willing to count anything as a simplification that uses O(n) characters where the factor is significantly smaller than in the naive example (i.e., adding one more case makes the query string grow by less than OR (X=... AND Y=...)) even though there is perhaps more constant overhead.

Advertisement

Answer

Yes, you may use WHERE IN (...) with tuples in MySQL:

Demo

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement