I am trying to figure out how to calculate MEDIAN in GROUPS within SQL (i.e. required to use NTILE() functions to indirectly calculate the median).
I read somewhere on the internet that some SQL servers do not support the MEDIAN function, whereas some of them do.
For example, I am doing something like:
select
count(*) as total_count,
median(height) as median_height,
median(weight) as median_weight
from football_players
group by country_of_origin;
This code ran correctly, but after having read that some SQL servers do not support the MEDIAN function, I am suspicious if I have done everything correctly.
I am using Netezza btw.
Is this correct?