datatable結(jié)構(gòu)是cat_id gdp_id qty1 2 31 2 41 2 52 1 12 1 2要求把cat_id和gdp_id相同的行合并成一行 并求出qty的平均值如何做
2 回答

慕運維8079593
TA貢獻1876條經(jīng)驗 獲得超5個贊
你這個好像是sql,和.net沒關(guān)系吧。
select cat_id, gdp_id, avg(qty)as 平均值
from tb
group by cat_id, gdp_id
結(jié)果是
cat_id gdp_id qty
1 2 6
2 1 1.5
- 2 回答
- 0 關(guān)注
- 369 瀏覽
添加回答
舉報
0/150
提交
取消