时间:2021-07-01 10:21:17 帮助过:452人阅读
student表
sc 表
首先where条件a.Sid = b.Sid 查询
SELECT * FROM student a,sc b WHERE a.Sid = b.Sid GROUP BY a.Sname ORDER BY a.Sid
结果:(from后用‘,’分隔,两表inner join 搜索出a,b表都有的数据)
left join 条件查询
select * from student a LEFT JOIN sc b ON a.Sid = b.Sid GROUP BY a.Sname order BY a.Sid
结果:(left join 连接,左表数据全部+右表符合on条件的数据。left join 左右表互换结果不一样)
SQL中LEFT JOIN 和 inner join 的区别
标签:logs 数据 images 左右 select left join png group by image