最後の行にエラーがあることがわかりました。誰かが代替案を教えてもらえますか?
INSERT INTO month_week_qty
(
site_id, cat_id, cat_name, scat_id, scat_name, sscat_id, sscat_name, duration, w_m, year, sum_qty
)
SELECT
c.site_id, NULL, NULL, NULL, NULL, NULL, NULL, 'month', MONTH(s.created_at), YEAR(s.created_at), ROUND( SUM( s.qty_ordered ) ) as qty
FROM cat_products c, sku_qty_brand s
WHERE (c.product_id = s.product_id)
GROUP BY c.site_id, MONTH(s.created_at)
ON DUPLICATE KEY UPDATE sum_qty = sum_qty + ROUND( SUM( s.qty_ordered ) )