我们可以进一步优化这个查询吗:
我需要得到:
SELECT *
FROM table1
WHERE (column1, column2) in (SELECT c1, c2 FROM table2);
由于不支持上述查询:
我有以下查询:
SELECT *
FROM table1 join (SELECT c1, c2 from table2) as table3
ON table1.column1 = c1 and table1.column2 = c2
编辑:为简单起见,我添加了 table2。但实际上是
select c1, min(c2) from table2 group by c1;