How do I group query results by the hour part of a datetime column in SQLAlchemy?
This works for PostgreSQL:
.group_by(func.date_trunc('hour', date_col))
2.1m questions
2.1m answers
60 comments
57.0k users