Skip to content
Advertisement

Tag: divide

SQL divide row by row with the same column by using CASE

I want to create a new column which is to calculate the percentage, I know it can use subquery to do that, but is it possible to use CASE to do this? If using CASE how is the logic? Column A Column B Column C New Column that i want to create 2022-01-01 M0 72 72 * 100 / 72

Divide the results of two select queries

I have two SQL count queries that on their own work fine, they are: Now how to do I add to the query to get the percentage of 26/130?? I have a new query to go along with how to get percentages. Here it is: this brings back results below: If I remove the Distinct from my query there are

Advertisement