It is possible to combine two columns when querying in sqlalchemy.
ex, have the following table.
table 1 table 2 col1 col2 col3 col1 col2 col3 A 123 1 ABC A1B2 B 456 2 DEF C3D4 C 789 3 GHI E5F6
my query would be something like this:
session.query(table.col3, (table1.col2 + table2.col2)).join(table2)
and should give me the following results:
(1, 123A1B2) (2, 456C3D4) (3, 789E5F6)
how would i do that?
source share