标签:logs 数据 images 左右 select left join png group by image
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
原文地址:http://www.cnblogs.com/caoyajun33-blog/p/6814101.html