[sqlalchemy] Re: not the same number of columns in the 2 queries of the recursive request

2019-07-07 Thread Olivier SAINT-EVE
es = sub_territories.union( session.query(porteur.id,porteur.name,porteur.scale). \ # filter(porteur.id == relation.c.child_id). \ filter(porteur.id == relation.c.child_id). \ filter(relation.c.parent_id == sub_territories.c.id). \ filter(sub_territories.c.scale != 'region')) # sub_territ

[sqlalchemy] not the same number of columns in the 2 queries of the recursive request

2019-07-07 Thread Olivier SAINT-EVE
I created this recursive query: element0 = aliased(Territoire) sub_territories = session.query(element0, element0.id). \ filter(element0.id == 1). \ filter(element0.scale != 'Region'). \ cte(name='sub_territories', recursive=True) st_alias = aliased(sub_territori

[sqlalchemy] recursive CTE request : not the same number of columns in the 2 queries

2019-07-07 Thread Olivier SAINT-EVE
hello! I created this recursive query: element0 = aliased(Territoire) sub_territories = session.query(element0, element0.id). \ filter(element0.id == 1). \ filter(element0.scale != 'Region'). \ cte(name='sub_territories', recursive=True) st_alias = aliased(sub_