select distinct id,count
from table
group by id,count
==================================
结果是
015 2
017 1
017 2
017 3
018 2
019 2
================================
我想要的结果是
015 2
017 2 这个2是求id=017的平均值
018 2
019 2
==============================
在线等,急
from table
group by id,count
==================================
结果是
015 2
017 1
017 2
017 3
018 2
019 2
================================
我想要的结果是
015 2
017 2 这个2是求id=017的平均值
018 2
019 2
==============================
在线等,急
select distinct id,count
from table
group by id,count )
group by id
from table
group by id
from table
group by id
insert into #tab values('015',2)
insert into #tab values('017',1)
insert into #tab values('017',2)
insert into #tab values('017',3)
insert into #tab values('018',2)
insert into #tab values('019',2)select id,col=avg(col) from #tab group by idid col
---------- -----------
015 2
017 2
018 2
019 2(4 行受影响)