我有以下命令:
SELECT Date(mydate),sum(price),username from shop_table where Date(mydate)>'2011-01-07' GROUP BY Date(mydate),username因为日期包括时间,所以我使用Date()函数将它们转换为'only date‘,所以不管小时数,我都可以理解一天内的销售总额。
但是在peewee中有能力使用'fn‘来做这件事吗?
发布于 2019-01-16 09:12:14
可以,只需使用任何参数调用函数即可:
fn.DATE(MyModel.my_date)https://stackoverflow.com/questions/54185218
复制相似问题