select [NO]
,(select count(1)
from 表
where a=t.a
and b=t.b
and c=t.c
) as 'count'
from 表 t
where exists(select 1
from 表
where a=t.a
and b=t.b
and c=t.c
and [NO]<>t.[NO])
,(select count(1)
from 表
where a=t.a
and b=t.b
and c=t.c
) as 'count'
from 表 t
where exists(select 1
from 表
where a=t.a
and b=t.b
and c=t.c
and [NO]<>t.[NO])
,(select count(1)
from 表
where a=t.a
and b=t.b
and c=t.c
) as 'count'
from 表 t
where exists(select 1
from 表
where a=t.a
and b=t.b
and c=t.c
and [NO]<>t.[NO])
order by a,b,c
这个存储过程应该怎么写?还是直接调用select语句就可以,不用存储过程
(select a,b,c,count(*) as countnum from table_name group by a,b,c having count(*) >1 ) b
where a.a = b.a and a.b= b.b and a.c = b.c
order by b.countnum,a.no
biao a,(select a,b,c,count(*) as count from biao group by a,b,c) b
where a.a=b.a and a.b=b.b and a.c=b.c