Skip to content
Advertisement

Split 1 row into 2 rows with % of total

How can I convert each row into 2 rows, the first row having 75% of the total, and the other row being 25% of the total where I can also then include other columns?

Advertisement

Answer

Create a CTE with the 2 percentages and cross join it to the table:

See the demo.
Results:

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement