When the condition is based on one column, I can use either IN, AND, or OR, but if the condition is based on two columns, how to write the query? For example, I need to set up the value of column 1 to NULL in the following rows: column 2 = 'red' AND column 3 =' Monday', column 2 = 'yellow' and column 3 = 'Tuesday'. 'red' or 'yellow' is not unique in column 2, the same for 'Monday' and 'Tuesday'. I have quite of few of rows need to be updated. How can I do this in one query?
column1 column2 column3
1 red Monday
2 red Tuesday
3 yellow Monday
4 yellow Tuesday
5 green Wednesday
The results look like this:
column1 column2 column3
NULL red Monday
2 red Tuesday
3 yellow Monday
NULL yellow Tuesday
5 green Wednesday