我们在聚合或者字段名很长的时候我们就可以来使用别名

别名的使用方法 label :

result = pg_conn.query(GeographyAffiliation.location,
                       func.sum(GeographyAffiliation.count).label("count")).filter(
                       *filters).group_by(GeographyAffiliation.location).all()

 

相关文章:

  • 2022-01-26
  • 2022-12-23
  • 2022-12-23
  • 2021-09-19
  • 2022-01-16
  • 2021-05-28
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-08
  • 2021-11-05
  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案