日常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’)

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