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`);
精彩评论