I need to calculate the percentage of Confirmed vs Preliminary in a table generated by SQL in Athena. The fenced code block below shows the table.
Calculation england_0to1_weeks england_1to2_weeks
Preliminary 17 19
Confirmed 10 16
I would like to add a row at the bottom of the table that calculates the percentage of Confirmed vs Preliminary (formula is Confirmed/Preliminary * 100
):
Calculation england_0to1_weeks england_1to2_weeks
Preliminary 17 19
Confirmed 10 16
Percentage 59 84
I have tried using union all
, pivot
and unpivot
but may be using these wrong. Any help would be hugely appreciated!