I have a table 'tb1' with fields 'id' (unique) and 'rid' (not unique), both are number). Also I have an array $arr contains numbers. Now I need to UPDATE some records so that:
+ If the record has rid=3, then check to see if 'id' in the array $arr. If 'id' is not, set rid=3, otherwise, do nothing
+ If the record has 'id' in $arr, set rid=3.
I'm looking forward to combine it into one UPDATE statement only. Is it possible?