Calculating the median

104 views
Skip to first unread message

Daniel Hocking

unread,
Apr 30, 2018, 2:22:31 AM4/30/18
to COMP9311 Project Q&A
There was a previous question that asked if certain aggregate functions like percentile_cont could be used, from some testing it seems the version of pgsql used on grieg doesn't support that function so that's the easy way to calculate median out. 

Another method might used limit and offset but the instructions say that limit can't be used either. 

I can think of some other significantly less efficient methods to determine the median but I'm just wondering if I'm missing something obvious on my first two points?

Zhe Zhang

unread,
Apr 30, 2018, 2:26:58 AM4/30/18
to COMP9311 Project Q&A
Hi~ previous "questioner" here, seems the percentile_cont is support from v9.4 but we are in 9.3.3~

So I guess we need to find it out manually.

Daniel Krishnapillai

unread,
May 23, 2018, 5:57:48 AM5/23/18
to COMP9311 Project Q&A
You've probably figured out another way by now, but you could possibly use 'offset' and 'fetch next' to calculate the median
Reply all
Reply to author
Forward
0 new messages