gpt4 book ai didi

python - SQLAlchemy 有 bool_and 聚合函数吗?

转载 作者:行者123 更新时间:2023-11-29 12:52:40 25 4
gpt4 key购买 nike

我想对 GROUP BY 使用 bool_and 聚合函数,但我不明白如何在 SQLAlchemy 中实现它。我试过 func.and_ 但它似乎不起作用。

最佳答案

您可以创建(几乎)任何 SQL 函数表达式 from func by its name :

Note that any name not known to func generates 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

关于python - SQLAlchemy 有 bool_and 聚合函数吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50343523/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com