查詢SQLAlchemy的我想這如何通過月份名稱
db_session.query(PaymentsMade).filter(func.strftime('%B', PaymentsMade.created_at) == "August").all()
,但我得到這個錯誤
(ProgrammingError) function strftime(unknown, timestamp without time zone) does not exist
LINE 3: WHERE strftime('%B', paymentsmade.created_at) = 'August'
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
和現在的儲蓄created_at = datetime.utcnow()
您使用的數據庫是? –
** postgres **謝謝你的回覆 – sunny