我只使用where for update查询和条件是更好的方法还是有更好的方法?
下面是我的sql查询的一个示例,如果 Order_ID = 10
加 payment_check is N
或者 response_msg is null
,如果我的问题是错误的,请纠正我。
UPDATE dbo.sample1
SET Payment_Generated = 'Y',
Transaction_ID = '123',
Response_Msg = 'ok',
Response_Code = '1',
Created_on = '2020-05-29T11:29:30'
WHERE Order_ID = '10' and Payment_Check = 'N' or Response_Code IS NULL
如果付款检查为n或响应代码为空,则为预期结果
Payment_Generated = 'Y',
Transaction_ID = '123',
Response_Msg = 'ok',
Response_Code = '1',
Created_on = '2020-05-29T11:29:30'
Order_ID = '10'
Payment_Check = 'N'
暂无答案!
目前还没有任何答案,快来回答吧!