本文介绍了如何使用c#合并表行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,

我使用的是Asp.net 4.0和c#语言。我有数据表并存储了以下值,我需要合并单个员工的值,如下例所示。我不知道怎么做任何一个请帮我怎么做



原始表。



Ramakrishnan_N 30 42.08 71%12.08

Beeresh_H E 30 36.6 82%6.6

Jeyapandiyan_V 12 19.75 61%7.75

Ramakrishnan_N 4.25 6.95 61%2.7

Beeresh_H E 6 10.38 58%4.38

Jeyapandiyan_V 16.87 8.89 190%-7.98





预期产出:



Ramakrishnan_N 34.25 49.03 132%14.78

Beeresh_H E 36 46.98 140%10.98

Jeyapandiyan_V 28.87 28.64 251%-0.23



预付款,



问候,

Karthik M

Dear all,
I am using Asp.net 4.0 and c# language. I have Datatable and stored the Following values i need to Consolidate the Values of the individual employee like below Example. I dont know how to do it any one please help me how to it

Original Table.

Ramakrishnan_N3042.0871%12.08
Beeresh_H E3036.682%6.6
Jeyapandiyan_V1219.7561%7.75
Ramakrishnan_N4.256.9561%2.7
Beeresh_H E610.3858%4.38
Jeyapandiyan_V16.878.89190%-7.98


Expected Output:

Ramakrishnan_N34.2549.03132%14.78
Beeresh_H E3646.98140%10.98
Jeyapandiyan_V28.8728.64251%-0.23

Advance Thanks,

Regards,
Karthik M

推荐答案

SELECT Name, SUM(MyColumn1), SUM(MyColumn2) FROM MyTable
GROUP BY Name


这篇关于如何使用c#合并表行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 23:13