Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我如何将这样的东西翻译成 SQLAlchemy?
SELECT (a * b) - (x + y) / z AS result FROM table ORDER BY result
只需将标签作为字符串参数传递给order_by:
order_by
result_exp = sqlalchemy.sql.expression.label('result', ((test2_table.c.a * test2_table.c.b) - (test2_table.c.x + test2_table.c.y) / test2_table.c.z)) select([result_exp], from_obj=[test2_table], order_by="result")