我有一個表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