开发者

MySQL set NULL Query not always works

开发者 https://www.devze.com 2022-12-20 20:33 出处:网络
UPDATE `table` SET `sent`=\'1\', `taken`=\'开发者_开发问答1\', `free`=NULL WHERE `owner`=\'1\' AND ISNULL(`sent`) AND !ISNULL(`free`);
UPDATE `table` 
SET `sent`='1', `taken`='开发者_开发问答1', `free`=NULL
WHERE `owner`='1' AND ISNULL(`sent`) AND !ISNULL(`free`);

Works, but set free to NULL not always works. Any ideas? Thx


Check your triggers.


UPDATE `table` 
SET `sent`='1', `taken`='1', `free`=NULL
WHERE `owner`='1' AND `sent` is null AND `free` is not null;


Execute the following query to check if it returns all the records you request:

SELECT *
FROM `table`
WHERE `owner`='1' AND ISNULL(`sent`) AND !ISNULL(`free`);
0

精彩评论

暂无评论...
验证码 换一张
取 消