select distinct saddress from students; 去重
select * from students order by sgrade desc/asc; 排序(升序/降序)
select avg(sgrade),sname from students group by sname
先分组然后在对每组分别使用集函数(此处为平均值)
select students.sname,sc.courseid,sc.grade from students inner join sc on students.sno=sc.studentsid;
select students.sname,sc.courseid,sc.grade from students,sc where students.sno=sc.studentsid; (一般用这个)
内连接
select students.sname,sc.courseid,sc.grade from students right join sc on students.sno=sc.studentsid;
右外连接
网友评论