Question: how to calculate percent of total in sql?
Answer: SQL Percent To Total The subquery SELECT SUM(Sales) FROM Total_Sales calculates the sum. We can then divide the individual values by this sum to obtain the percent to total for each row.