Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/358.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何在算术表达式的结果上添加SQLAlchemy标签?_Python_Sqlalchemy - Fatal编程技术网

Python 如何在算术表达式的结果上添加SQLAlchemy标签?

Python 如何在算术表达式的结果上添加SQLAlchemy标签?,python,sqlalchemy,Python,Sqlalchemy,我如何将这样的东西转化为炼金术 select x - y as difference... 我知道怎么做: x.label('foo') …但我不确定下面的“.label()”方法调用放在哪里: select ([table.c.x - table.c.y], ... ColumnElement方法只是一个助手;可按以下方式使用: select([sql.expression.label('foo', table.c.x - table.c.y), ...])

我如何将这样的东西转化为炼金术

select x - y as difference...
我知道怎么做:

x.label('foo')
…但我不确定下面的“.label()”方法调用放在哪里:

select ([table.c.x - table.c.y], ...

ColumnElement
方法只是一个助手;可按以下方式使用:

select([sql.expression.label('foo', table.c.x - table.c.y), ...])