我有一个查询在其where子句中包含select
语句。我现在的问题是,我怎样才能访问父母的select
的数据。在where子句中选择对当前父选择列的访问
实施例:
select * from TABLE_1 as t1 INNER JOIN TABLE_2 as t2
where (... and ...) OR
(not exists(select * from TABLE_3 as t3
inner join TABLE_1 ON t3.t1_id = t1.id
最后一行是在错误发生时:t1.id is not a column
。
如何从表t1访问当前值? 我使用MySQL 5.1中
你能发布完整的查询吗? – Teja 2012-03-29 14:50:43
您需要将内部table_1作为t4,并且具有以下条件ON t3.t1_id = t4.id其中t4.id = t1.id – 2012-03-29 14:51:35