左连接只影响右表,右链接只影响左表。
 
左连接   (left join)
    select *  from table1 left join tbale2 on table1.id=table2.id
这条sql语句返回结果   table1表中的数据全部返回   table2表中的数据只返回满足where条件的
 
右链接   (right join)
    select * from table1 right join table2 on table1.id=table2.id
这条sql语句返回结果   table2表中的数据全部返回    table1表中的数据只返回满足where条件的
 
         (insert join)
    select * from table1 inner join table2 on table1.id = table2.id
这条sql语句返回结果   显示满足条件的数据   并不以谁为主表

相关文章:

  • 2021-05-03
  • 2022-01-01
  • 2022-12-23
  • 2021-07-23
  • 2022-12-23
  • 2022-01-25
  • 2022-12-23
  • 2021-05-20
猜你喜欢
  • 2022-12-23
  • 2022-02-07
  • 2021-12-31
  • 2021-12-30
  • 2022-01-16
  • 2022-02-01
相关资源
相似解决方案