日常mysql问题(eg:连表编码错误,获取上月第一天等)

编码不一致:
Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_unicode_ci,IMPLICIT) for operation ‘=’
在右边加上utf8mb4_unicode_ci;
删除上月数据(天)
delete from tb_sale_refund_comparison_day where day >= date_sub(date_sub(curdate(),interval extract(day from curdate())-1 day),interval 1 month);
删除上月数据(月)
delete from cst.tb_sale_refund_statistic where month = date_format(date_sub(curdate(), INTERVAL 1 MONTH),’%Y-%m’)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章