内连接:
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;
阅读(616) | 评论(0) | 转发(0) |