SELECT_NO_PROCESSED_QRCODES = "SELECT id, visit_date, added_in_monitoring FROM locations_qrcode " \
"WHERE DATE_FORMAT(visit_date, '%Y%m%d') = %(value)s"
此SQL在python(def)函数之外工作得非常好。
这是因为MySQL的DATE_FORMAT
因为在Python函数中而停止工作吗
我的访问日期字段是一个日期时间字段,我需要在SQL中使用strftime
来转换为(“%Y-%m-%d”),我如何才能做到这一点
比如:strftime(visit_date,'% Y-% m-% d')
1370(42000):对于例程“visit_date.srftime”,对用户“erico”@“%”拒绝执行命令
用户-密码和数据库正常
相关问题 更多 >
编程相关推荐