Closed saknius closed 4 months ago
You can write a wrapper:
from peewee import *
from peewee import NodeList
def percentile_cont(amt, order_by):
return NodeList((
fn.PERCENTILE_CONT(amt),
SQL('WITHIN GROUP(ORDER BY '),
order_by,
SQL(')'),
))
Table.select(percentile_cont(0.5, Table.x))
i wanted to execute this in peewee
SELECT PERCENTILE_CONT(0.5) WITHIN GROUP(ORDER BY x) FROM t;
by any chance is fn.PERCENTILE_CONT supported in peewee or if there is any workaround please suggest.