sql 中如何统计每项的重复数量 select 特长,count(学生名字)from 表名 group by 特长
SQL语句,按重复数据的数量排序 select A,B,C from(select A,B,C,(select count(1)from Table tb where tb.B=t.B)as cnt_B,(select count(1)from Table tc where tc.C=t.C)as cnt_C from Table t)order by cnt_C desc,cnt_B desc
sql数据库,取重复项数量。 select top1 chujiazhefromselect chujiazhe,min(chujia)AS zuidijiage,count(*)AS cishu,min(chujiatime)AS zuizaoshijianfrom JP_JILUgroup by chujiaorder by min(chujia),count(*),min(chujiatime)没测试 有问题 再追问吧!