select A.*, B.* from A inner join B where B.item='X'select A.*, B.* from A, B where B.item='X'返回的记录条数是一样的。这两个有什么区别呢

解决方案 »

  1.   

    以上两句是等价的。只不是一个是显示的说明是内连接,一个是隐式的内连接.
    select A.*, B.* from A inner join B where B.item='X';
    此处的红色部分究竟是where还是on,忘了,好像应该是on吧!
      

  2.   

    join 必须与ON 进行匹配使用select A.*, B.* from A inner join B on 1=1 where B.item='X';
    两个语句是等价的.
      

  3.   

    哦,这个是写错了。
    也就是inner join和直接写from两个表等价的,并不是说只是上面的例子是等价的吧
      

  4.   

    是等价的吧,好像年龄大些的都不喜欢 from 表1,表2 where 这种写法. 
      

  5.   

    用inner join的话on后面的连接条件会在where之前执行,效率肯定是有区别的,那个效率高要看情况