Calculate percentage value for each row based on total column value in SQL Server

Viewed 8966

I have a table like below. I need to calculate percentage value for each row based on total column value. How to achieve this with a SQL query?

enter image description here

I am expecting results like this:

enter image description here

Please find the below simple calculation to get result.

(100 / 1000) * 100 = 10

for the first value.

(row value / grand total) * 100

Can you please help me to get 10 as result for the first row value with a SQL query? Thanks in advance.

2 Answers
Related