您好,我想更新或插入应用程序,但它显示错误。知道如果我删除更新或查询有效
UPDATE OR INSERT INTO stat_alert(`DAT`,`provider`,`CI`,`cell`,`BSC`,`cmts`,`nbr`,`TYPE`)
SELECT CC.DAT,CC.provider,CC.CI,CC.cell,CC.BSC,CC.cmts, CONCAT(CC.C,'C, ',MM.M ,'M') AS nbr,'C' AS TYPE FROM
(SELECT DAT,provider,CI,cell,BSC,cmts,COUNT(*) AS C FROM alertes_bss2 WHERE Criticity = 'C' GROUP BY cell,Criticity ) AS CC,
(SELECT DAT,provider,CI,cell,BSC,cmts,COUNT(*) AS M FROM alertes_bss2 WHERE Criticity = 'M' GROUP BY cell,Criticity) AS MM WHERE MM.cell = CC.cell
UNION SELECT DAT,provider,CI,cell,BSC,cmts, CONCAT(COUNT(*) ,'C') AS nbr,'C' AS TYPE FROM alertes_bss2 WHERE Criticity = 'C' AND cell NOT IN
(SELECT cell FROM alertes_bss2 WHERE Criticity = 'M') GROUP BY DAT,provider,CI,cell,BSC,Criticity
UNION SELECT DAT,provider,CI,cell,BSC,cmts, CONCAT(COUNT(*) ,'M') AS nbr,'M' AS TYPE FROM alertes_bss2 WHERE Criticity = 'M' AND cell NOT IN
(SELECT cell FROM alertes_bss2 WHERE Criticity = 'C') GROUP BY DAT,provider,CI,cell,BSC,Criticity;
我有这个错误:
Query: UPDATE OR INSERT INTO stat_alert(`DAT`,`provider`,`CI`,`cell`,`BSC`,`cmts`,`nbr`,`TYPE`) SELECT CC.DAT,CC.provider,CC.CI,CC.cell...
Error Code: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OR INSERT INTO stat_alert(`DAT`,`provider`,`CI`,`cell`,`BSC`,`cmts`,`nbr`,`TYPE' at line 1
Execution Time : 0 sec
Transfer Time : 0 sec
Total Time : 0.003 sec
---------------------------------------------------
谁能帮我