我正在尝试按月打包一些事件。
date_list = func.generate_series(start, end, '1 month')
db.session.query(func.count(Event.id)).join(date_list, true()).outerjoin(Event, Event.time==func.date(date_list)).all()
但是我收到一个错误:
不支持错误: (psycopg2.errors.FeatureNotSuped) 在 JOIN 条件中不允许使用返回集函数
将连接左侧的序列与 SQLAlchemy 结合使用,然后使用聚合式计数的简单示例是什么?
元芳怎么了
慕运维8079593
相关分类