一条巧妙的SQL语句

需求:从学生表中查询出所有姓名和班级都相同的学生信息。
SQL:select distinct name,class,count(*) as recordcount from student group by name,class having count(*)>1;

posted @ 2010-12-06 22:37  Jakin.zhou  阅读(119)  评论(0编辑  收藏  举报