【发布时间】:2012-10-16 07:06:39
【问题描述】:
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 查询。还需要子查询表中的一些数据。
例如说表 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
);
如果我使用外部查询的选择添加它们会给出错误“未知列”,这确实有意义。
是正确的方法还是应该用连接重写查询?
【问题讨论】:
-
显示失败的查询 - 我们可以提供更好的建议
-
添加了失败的查询。