1.select count(B) from A group by B having count(B)>1
2.select top 20 * from A
where ID not in(select top 75 ID from A order by ID)
and ID in(select top 95 ID from A order by ID)
3.select ID,
(select sum(B) from A where ID<=O.ID) sum
from A O
order by ID
1. select Sum(b)
from (select count(*)as b
from A
group by b
having count(*)>1)
2.用fancylee(小恐龙) 的
3
select ID, sum(B)
from (select A.ID, C.B
from A, a as C
where A.ID >= C.ID)
Group by ID