我有一个表2列... 它们是:我怎样才能获得百分(%)列使用TSQL代码
HCode No_of contacts
AA1 78
AA2 10
AA3 09
AA4 14
AA5 10
AA1 21
我写了下面的代码:
select HCode, Sum(No_of contacts) as NoOFContacts
from #T
Group by HCode
order by HCode
使用上面的代码,我如何根据max填充百分比列([No_of contacts])?
尽管这个问题有一个公认的答案我很好奇,以什么期望输出会是这样,因为输出从被接受的答案对我来说没有任何意义(但也许我只是愚蠢的)。 – jpw 2014-09-01 15:10:32