use tsgl
select *
from xs join jy join ts on xs.借书证号=jy.借书证号  on jy.ISBN=ts.ISBN
where 书名='线性代数'

解决方案 »

  1.   

    use tsgl
    go
    select *
    from xs join jy on xs.借书证号=jy.借书证号
     join ts  on jy.ISBN=ts.ISBN
    where 书名='线性代数'
      

  2.   

    use tsgl
    go
    select *
    from xs join jy on xs.借书证号=jy.借书证号 and jy.ISBN=ts.ISBN
    where 书名='线性代数'
      

  3.   

    use tsgl
    go
    select *
    from xs join jy on xs.借书证号=jy.借书证号 join ts on jy.ISBN=ts.ISBN
    where 书名='线性代数'
      

  4.   

    但是把两个on互换为什么又可以运行use tsgl
    select *
    from xs join jy join ts  on jy.ISBN=ts.ISBN on xs.借书证号=jy.借书证号
    where 书名='线性代数' 
     
     
      

  5.   

    use tsgl
    select *
    from xs 
    join jy on xs.借书证号=jy.借书证号
    join ts on jy.ISBN=ts.ISBN
    where 书名='线性代数'