Re: [sqlalchemy] recursive cte use current row as anchor

2021-09-24 Thread niuji...@gmail.com
Hi Mike, thanks for pointing out the direction. I've worked out the SQL, but failed when converting to SQLAlchemy construct. My SQL query looks like this: SELECT id, ( WITH lineage_nodes (id, _enabling_factor, selfreferencing_staff_id) AS ( SELECT anchor_s.id, anchor_

Re: [sqlalchemy] recursive cte use current row as anchor

2021-09-24 Thread Mike Bayer
this is a hefty query to dig in to but column_property() subqueries have to be formed in terms of a correlated subquery. So instead of injecting a particular primary key into it, you set it to point to the Staff.id column. correlated subqueries are not terrific performers and the construct can