I'm struggling to find the solution for a simple median problem. Given a table my_table
with just one column:
my_column |
----------|
10 |
20 |
30 |
40 |
50 |
60 |
How can I call a function to return the median of 35?
I can't figure out how to make this syntax work when all I want is to return the median value:
SELECT
PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY my_column) OVER ( PARTITION BY my_column)
FROM
my_table