Learning SQL, need some help with the following single column median function:
Msg 8120, Level 16, State 1, Line 4
Column 'TBL_US_Counties_Pop_Est_2019.pop_est_2019' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
select
sum(pop_est_2019) as county_sum,
round(avg(pop_est_2019),0) as county_average,
percentile_cont(0.5) within group (order by pop_est_2019) over(partition by pop_est_2019) as county_median
From TBL_US_Counties_Pop_Est_2019