These two links are related to this question I guess, but I do not find a way out to solve my requirement which is slightly different.
I have a table, say like this:
fruit color
--------------------
mango red
apple red
orange yellow
banana green
I need to UPDATE
field color
in such a way that red
becomes yellow
and yellow
becomes red
. Here is how the table should look like after update query.
fruit color
--------------------
mango yellow
apple yellow
orange red
banana green
This query wont work obviously.
UPDATE plant SET color = 'yellow' WHERE color = 'red';
UPDATE plant SET color = 'red' WHERE color = 'yellow'
Thanks.