flask-sqlalchemy - 如何将postgresql查询转换为flask sql alchemy
问题描述
我想将 PostgreSQL 查询转换为烧瓶 SQL 炼金术:
PostgreSQL 查询:
select event_data.location_id,
event_data.job_id, event_data.area_id,
min(temperature) as min_temp,
max(temperature) as max_temp, min(humidity) as min_humidity, max(humidity) as max_humidity,
(date_trunc('month', payload_time)::date) as from_date,
((date_trunc('month', payload_time) + '1 Month - 1 day' ) ::date) as to_date,
min(airpressure) as min_pressure, max(airpressure) as max_pressure from eco_event_data_log
where area_id =27 group by location_id, job_id, area_id, from_date, to_date;
解决方案
推荐阅读
- android - 如何使用 Jetpack Compose 实现 GoogleSignIn?
- svg - svg的d属性中的破折号“-”是什么意思?
- c# - 为什么我在获取访问令牌时会在 C# 中获得 AADSTS50196 请求循环?
- c++ - 按位左移为 2 的幂
- postgresql - 无法为插入查询执行 gradlew flywayMigrate
- github - 为存储库中的每个模块动态运行 GitHub Action
- python - 如何在Python中以分层方式从已经预测的类簇中预测子类
- php - 如何使用特定 ID 填充表单值
- sharepoint-online - 如何更正使用 Power Automate 时向 SharePoint 发送 HTTP 请求操作失败。输入字符串格式不正确错误
- python - 正则表达式在 Pandas 中获取连字符前后的文本