错误现象
delete from PaidInRecord pr WHERE pr.packageNumberId= 5661 and pr.contractInfoId= 3235 and pr.repaymentApplyId=179389 and pr.isMatchAll=2;
ERROR 1064 (42000): 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 'pr WHERE pr.packageNumberId= 5661 and pr.contractInfoId= 3235 and pr.repaymentAp' at line 1
单独执行sql
select * from PaidInRecord pr WHERE pr.packageNumberId= 5661 and pr.contractInfoId= 3235 and pr.repaymentApplyId=179389 and pr.isMatchAll=2;
执行成功
但是执行删除
delete from PaidInRecord pr WHERE pr.packageNumberId= 5661 and pr.contractInfoId= 3235 and pr.repaymentApplyId=179389 and pr.isMatchAll=2;
报错
需要将 sql改成如下,即可
DELETE from PaidInRecord WHERE packageNumberId= 5661 and contractInfoId= 3235 and repaymentApplyId=179389
and isMatchAll=2;
Query OK, 199 rows affected (0.07 sec)