SQLAlchemy是否有bool\u和aggregate函数?

2024-04-25 22:01:30 发布

您现在位置:Python中文网/ 问答频道 /正文

我想为groupby使用bool_and聚合函数,但是我不知道如何在SQLAlchemy中实现它。我试过func.and_,但似乎不起作用。在


Tags: and函数sqlalchemyboolfuncgroupby
1条回答
网友
1楼 · 发布于 2024-04-25 22:01:30

您可以创建任何SQL函数表达式from ^{} by its name

Note that any name not known to funcgenerates the function name as is - there is no restriction on what SQL functions can be called, known or unknown to SQLAlchemy, built-in or user defined.

所以答案是:

func.bool_and(...)

有一些函数是SQLAlchemy已知的并得到特殊处理的,例如CURRENT_TIMESTAMP。在

相关问题 更多 >