Re: [sqlalchemy] Percentile calculation

2019-08-05 Thread Mike Bayer
note also pysqlite allows Python functions to embedded in SQL directly, which can do the percentile_cont() part but not the WITHIN GROUP part. https://docs.python.org/3/library/sqlite3.html#sqlite3.Connection.create_aggregate On Mon, Aug 5, 2019, at 6:30 PM, Jonathan Vanasco wrote: > > > On

Re: [sqlalchemy] Percentile calculation

2019-08-05 Thread Jonathan Vanasco
On Monday, August 5, 2019 at 3:21:40 PM UTC-4, Michael wrote: > > Thanks a lot! Indeed SQLite seems to be the problem and the code works > fine with PostgreSQL. > > Unfortunately, a full fledged database server is not an option. Therefore > I probably have to work around the problem in Python.

Re: [sqlalchemy] Percentile calculation

2019-08-05 Thread Mike Bayer
On Mon, Aug 5, 2019, at 3:21 PM, Michael wrote: > Thanks a lot! Indeed SQLite seems to be the problem and the code works fine > with PostgreSQL. > > Unfortunately, a full fledged database server is not an option. Therefore I > probably have to work around the problem in Python. > > Is there

Re: [sqlalchemy] Percentile calculation

2019-08-05 Thread Michael
Thanks a lot! Indeed SQLite seems to be the problem and the code works fine with PostgreSQL. Unfortunately, a full fledged database server is not an option. Therefore I probably have to work around the problem in Python. Is there an easy way to obtain a list of objects generated by multiple

Re: [sqlalchemy] Percentile calculation

2019-08-05 Thread Mike Bayer
does SQLite support WITHIN GROUP ? Try it out on PostgreSQL, I think this is just not syntax SQLite supports. On Mon, Aug 5, 2019, at 10:38 AM, Michael wrote: > Hi! > > I'm really having a great time with sqlalchemy so far! > > Currently I'm trying to apply a percentile function on a ORM sche

[sqlalchemy] Percentile calculation

2019-08-05 Thread Michael
Hi! I'm really having a great time with sqlalchemy so far! Currently I'm trying to apply a percentile function on a ORM schema with sqlite3. Average, min, max etc are working fine, but i cannot compute the median or any other percentile using 'percentile_cont'. A minimal example and the corr