mysql连接查询语句示例

eg:

内连接:
    select student.*,grade.* from student join grade where student.sid=grade.sid;
    select s.*,g.* from student as s join grade as g where s.sid=g.sid;
 
 
外连接:
    左连接(左边的主,左边的数据多有)
    select * from student left join grade on student.sid=grade.sid;
    右连接
    select * from student right join grade on student.sid=grade.sid;
原文地址:https://www.cnblogs.com/fanxuanhui-linux/p/6189216.html