- changed status to resolved
can't use in_(someselect) as a column expression in another select
Issue #1074
resolved
from sqlalchemy import *
from sqlalchemy.sql import table, column
t1 = table('t1', column('c1'))
col = t1.c.c1.in_(select([t1.c.c1](t1.c.c1)))
sel = select([col](col))
print sel
the from list of the embedded select gets exported. If you call as_scalar() on it explicitly, you get a warning and then two levels of parens. The in_() should handle calling as_scalar() on the embedded select in all cases to prevent FROM exporting and fix the double parens.
Comments (2)
-
reporter -
reporter - removed milestone
Removing milestone: 0.4.xx (automated comment)
- Log in to comment
d47a469732f0695c612615819c3273afbb28ed76 4a98ddde1676d91b9eadf9b59de11c132c1abf4f
to support (x, y, z) IN (SELECT x, y, z FROM table) we'd need to add a new kind of scalar select that supports multiple columns (or just take this requirement off of the existing
_ScalarSelect
).