其实你的问题根本就没问清楚,到以下2句中找找答案吧
select a.*,b.* from a,b where a.id=b.id
select a.* from table a,(select id from table2 )b where a.id=b.id
select a.*,b.* from a,b where a.id=b.id
select a.* from table a,(select id from table2 )b where a.id=b.id
--------------------------------------------
select * from (select * from a aa inner join b bb on aa.id=bb.id) a
select * from (
select max(id), name from a as b,
select max(id), value from c as d)
where b.id = d.id
主要是两个已经进行过查询的表再进行联荷
其中的b如果也是一个自查询,语法改怎么写呢?
select * from (
select * from 表a
union all
select * from 表b ) t只要表a 和表b的字段一致就可以
select * from (
select max(id), name from a as b,
select max(id), value from c as d)
where b.id = d.id
主要是两个已经进行过查询的表再进行联荷---------------------------------------------
select * from (select max(id), name from a) b,
(select max(id), value from c ) d
where b.id=d.id