SyntaxFix
Write A Post
Hire A Developer
Questions
The documentation on counting says that for group_by queries it is better to use func.count():
group_by
func.count()
from sqlalchemy import func session.query(Table.column, func.count(Table.column)).group_by(Table.column).all()