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