去重复select now() from student; select distinct now() from student; //一个列 select distinct ssex,sname from student; //两个列 count select count(sid) from student; //sid的个数有几个 select count(*) from student; //只要那 分组:在前面知识点里面 嵌套:select * from student where chinese = (select max(chinese) from student); //查询表格中语文成绩最高的人 select * from (select sname,ssex,sage,classid from student) newtable; // 只查询几列 新表格是newtable select * from (select sname,ssex,sage,classid from student) newtable where sage>=18; //再次查询 select * from student where classid = (select classid from myclass where classloc = 'hangzhou'); //表格不是一张