','附近的语法不正确..

Abi*_*Ali 0 sql

我执行此查询时出错.

Delete from customerpayment where customerid = 8, Paymentid = 1 , currentpayment = '132', startdate = '1/1/2011', enddate = '12/31/2011', status = 'Paid';
Run Code Online (Sandbox Code Playgroud)

dar*_*ioo 6

使用and而不是,你的查询应该工作.

更确切地说:

delete from customerpayment where customerid = 8 and Paymentid = 1 and currentpayment = '132' and startdate = '1/1/2011' and enddate = '12/31/2011' and status = 'Paid';
Run Code Online (Sandbox Code Playgroud)

一些建议:似乎你正在使用string数据结构来表示日期.这是不好的做法,你应该使用你的数据库的内部日期结构来做这样的事情.

如果currentpayment始终是一个数字,请不要使用string.

如果您只有几个可能的status值,而是使用具有所有可能状态值的不同表,然后根据id加入它.