a1和a2在a表中具有唯一性
b1和b2在b表中具有唯一性
现在需要连接c表和d表
需要分两步来做
1.先让c表join表a和表b
select c.*,a.a2,b.b2 from c
inner join a on c.a1=a.a1
inner join b on c.b1=b.b1
将这个的结果存在e表
2.让表e和表d进行join
select * from d
inner join e on d.a2=e.a2 and d.b2=e.b2
这样就实现了c和d的连接