select t1.table1 from table1 as t1
where t1.column1
in
(
select t2.column2 from table2 as t2
join
table3 as t3 on t2.column1=t3.column1
where t3.columnx=5
);
上面是我正在發射的mysql查詢。也希望從子查詢表中獲取一些數據。從子查詢中選擇數據mysql
例如說t2表中的columnxy。失敗
select t1.table1,t2.columnxy from table1 as t1
where t1.column1
in
(
select t2.column2 from table2 as t2
join
table3 as t3 on t2.column1=t3.column1
where t3.columnx=5
);
如果我有選擇的外部查詢的添加它們
查詢提供了錯誤「未知列」,這有一定道理。
是正確的方式還是應該用連接重寫查詢?
顯示失敗查詢 - 我們可以建議更好 – BugFinder
補充說,失敗的查詢。 – amitchhajer