select 姓名 ,count(姓名) 不及格科目数 from table1 group by 姓名 order by count(姓名) desc 既然是在asp中用的那个不及格科目数就用不着了(你的数据库不该会是access吧)去掉即可select 姓名 ,count(姓名) from table1 group by 姓名 order by count(姓名) desc 但要注意里面的空格,多了会报错的,最好先放到查询分析器中测试一下按照编号倒序排列==,不能这样做,因为你的group by 姓名 而编号是唯一的.语义不通.
select 姓名 ,count(姓名)AS ‘不及格科目数’ from table1 group by 姓名 order by count(姓名) descselect 姓名 ,count(姓名)AS ‘不及格科目数’ from table1 group by 姓名 order by count(姓名) desc