如果多个表关联,到底是怎么取数据的?比如 a full outer join b ON a.xx=b.xx inner join C on a.xx=c.xx and b.xx=c.xx
这里面 a和b,是全都取出来,这点我知道。
但是现在关联了c,那么取到的数据,是不是 a和 c的内联,再加上b和c的内联?

解决方案 »

  1.   

    SELECT * 
    FROM a 
    full outer join b 
    ON a.xx=b.xx --#1.a和b先产生一个结果集
    inner join C 
    on a.xx=c.xx and b.xx=c.xx --#2.上面的结果集看成一个表,再和C表INNSER JOIN
      

  2.   

    it depends, ms database engine could do some tunnings, it may not follow the t-sql table order. You can check sql server excution plan.