Hi friends,
I am using some expressions in the select values itself like this.
data = select([testb.c.var1.op('&')(5)]).From(testb).execute()
But the corresponding SQL generated is
SELECT (testb.var1 & $1) != $2 AS anon_1 FROM testb, Args: (1, 0)
I can't label the column-like testb.c.var1.op('&')(5).label('Var'). Why
this happening and how can I label that column with a valid name. Please
help.
also tried (but getting error),
- data =
select([testb.c.var1.op('&')(5).label('VAR')]).From(testb).execute()
- data =
select([testb.c.var1.label('VAR').op('&')(5)]).From(testb).execute()
- data =
select([testb.c.var1.alias('VAR').op('&')(5)]).From(testb).execute()
- data =
select([testb.c.var1.op('&')(5).alias('VAR')]).From(testb).execute()
--
SQLAlchemy -
The Python SQL Toolkit and Object Relational Mapper
http://www.sqlalchemy.org/
To post example code, please provide an MCVE: Minimal, Complete, and Verifiable
Example. See http://stackoverflow.com/help/mcve for a full description.
---
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sqlalchemy/c9e4becd-e72f-4797-aea7-b0bac759ccf2%40googlegroups.com.