select * from A inner join B on xx=xx;和select * from A,B where xx=xx;有什么区别吗 最好能举个例子说明下在复杂点的应用里的区别

解决方案 »

  1.   

    没有区别declare @t table (xx int,tt int)
    insert into @t values(1,14)
    insert into @t values(2,12)
    insert into @t values(3,16)
    insert into @t values(4,15)
    insert into @t values(5,14)
    insert into @t values(6,13)
    insert into @t values(7,12)
    insert into @t values(8,11)
    declare @b table (xx int,tb int)
    insert into @b values(1,114)
    insert into @b values(2,122)
    insert into @b values(3,156)
    insert into @b values(4,135)
    insert into @b values(5,174)
    insert into @b values(6,153)
    insert into @b values(7,182)
    insert into @b values(8,112)
    select * from @t t inner join @b b on t.xx=b.xx
    select * from @t t  ,@b b where  t.xx= b.xx
    (1 row(s) affected)
    xx          tt          xx          tb
    ----------- ----------- ----------- -----------
    1           14          1           114
    2           12          2           122
    3           16          3           156
    4           15          4           135
    5           14          5           174
    6           13          6           153
    7           12          7           182
    8           11          8           112(8 row(s) affected)xx          tt          xx          tb
    ----------- ----------- ----------- -----------
    1           14          1           114
    2           12          2           122
    3           16          3           156
    4           15          4           135
    5           14          5           174
    6           13          6           153
    7           12          7           182
    8           11          8           112(8 row(s) affected)