I saw at many places on the internet that you could use generate_series function (in postgreSQL) like shown below:
select k, percentile_disc(k) within group (order by things.value)
from things, generate_series(0.01, 1, 0.01) as k
group by k
And it works like :-
generate_series generates temporary table with values between a starting and ending value, with an optional step. In this example, generate_series(0.01, 1, 0.01) returns 0.01, 0.02, etc..
But in my case it shows error saying it does not exist.
QL Error [42883]: ERROR: function generate_series(numeric, integer, numeric) does not exist Hint: No function matches the given name and argument types. You may need to add explicit type casts.
Could anyone please help me with the code on how to create this function explicitly.
It will be of great help!