摘要:
select to_char(date_published, 'yyyymm') yo from blog group by yo;转换成sqlalchemy 语句可以使用 extract()In[3]: year_field = db.func.extract('year', ArticleModel.date_published)In[4]: month_field = db.func.extract('month', ArticleModel.date_published)In[5]: yonth_field = year_field *1 阅读全文