当前位置:Gxlcms > 数据库问题 > sql中left join、right join与inner join的区别

sql中left join、right join与inner join的区别

时间:2021-07-01 10:21:17 帮助过:11人阅读

* from app01_publisher left join app01_book on app01_publisher.id = app01_book.publish_id

 

2.2、查询结果

技术分享图片

3、right join

  right join(右联接) 返回包括右表中的所有记录和左表中联结字段相等的记录。

3.1、sql语句

select * from app01_publisher right join app01_book on app01_publisher.id = app01_book.publish_id

 

3.2、查询结果

技术分享图片

4、innner join

  inner join(等值连接) 只返回两个表中联结字段相等的行。

4.1、sql语句

select * from app01_publisher inner join app01_book on app01_publisher.id = app01_book.publish_id

 

4.2、查询结果

技术分享图片

 

sql中left join、right join与inner join的区别

标签:pre   rom   src   联结   图片   _id   com   记录   返回   

人气教程排行