I have a scalar sub query with a predicate that involves a table and column 
produced in the
outer query, Company.id for example. The only way I could include the query 
was to write
it out literally and add it as a column with literal_column.

query = session.query(Company, City, <...>, literal_column(sub)).\
    join(City).\
    join(<...>).\
    filter(<...>)
    ...

I have the sub query written using the actual table classes etc, but could 
not find a way to
include the non text representation of the sql statement (sub) into the 
outer query.

How does one add a scalar column that requires values from the outer select?

Thanks,
jlc

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to