September 30th, 2000, 01:14 AM
what i would like to do is something like:
SET field = 1
WHERE field IN(1,2,3,4,5)
SET field = 0
WHERE field NOT IN(1,2,3,4,5)
except i want to do this in 1 query instead of 2, is this possible?
the reason i want to do this in only 1 query is that i don't want to take the chance that the first query will execute and then the second query fails, this would totally screw up the data
any solutions would be greatly appreciated
September 30th, 2000, 05:20 AM
update table set field=if(field IN(1,2,3,4,5),1,0);
September 30th, 2000, 11:12 AM
thanks rod, you just made my day!
[This message has been edited by RyanP (edited September 30, 2000).]