Możesz go (trochę) skompresować za pomocą:
SELECT * --- irrelevant to the question:
FROM table1 JOIN table2 --- use the explicit JOIN syntax
ON table1.id1 = table2.id2 --- not the implicit join with the
---table1,table2 where table1.id1 = table2.id2 --- WHERE syntax (removed)
WHERE
--- filters
AND (table1.col2, table2.col2) IN
( ('value_11', 'value_21'),
('value_12', 'value_22'),
('value_13', 'value_23'),
...
(value_1100, value_2200)
)
Jeśli masz te warunki filtrowania w tabeli, możesz to zrobić nawet:
AND (table1.col2, table2.col2) IN
( SELECT filter1, filter2
FROM filter_table
)