为什么sql出错
select * from xty_orders a where ORDER_STATUS= '已校对' and PATIENT_ID in
(select PATIENT_ID from xty_orders b where ORDER_STATUS = '已停止' GROUP BY PATIENT_ID HAVING count(PATIENT_ID) > 1)
上面检索正常,我改成删除就报错,为什么???
delete from xty_orders a where ORDER_STATUS= '已校对' and PATIENT_ID in
(select PATIENT_ID from xty_orders b where ORDER_STATUS = '已停止' GROUP BY PATIENT_ID HAVING count(PATIENT_ID) > 1)
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 'a where ORDER_STATUS= '已校对' and PATIENT_ID in
(select PATIENT_ID from xt' at line 1