I have aggregated column one column in the table as following
aggregated table:
*-------------------*
| territory | users |
*-------------------*
| worldwide | 20 |
| usa | 6 |
| germany | 3 |
| australia | 2 |
| india | 5 |
| japan | 4 |
*-------------------*
Below is my desired result in which I want to replicate 'worldwide' data as new column so I can calculate distribution of users.
desired output:
*-----------------------------------------------------*
| territory | users | ww_user | % users distribution |
*-----------------------------------------------------*
| worldwide | 20 | 20 | 0.0 |
| usa | 6 | 20 | 0.30 |
| germany | 3 | 20 | 0.15 |
| australia | 2 | 20 | 0.10 |
| india | 5 | 20 | 0.25 |
| japan | 4 | 20 | 0.20 |
*-----------------------------------------------------*
I have tried few options in db<>fiddle but none of them are getting me desired results.
can anyone give me a direction/idea on how to get my desired results?