如何为我的选择查询进行连接查询,如下所示。
"select a,b from table1 where d in
(select d from table2 where column1 ='value1' and column2 > '2' );"
答案 0 :(得分:2)
SELECT DISTINCT a, b
FROM table1 t1
JOIN table2 t2 ON t1.d = t2.d
WHERE t2.column1 = 'value1' AND t2.column2 = 'value2'