I have a table like this:
// numbers
+---------+------------+
| id | numb |
+---------+------------+
| int(11) | bit(1) |
+---------+------------+
| 1 | 1 |
| 2 | 1 |
| 3 | 0 |
| 4 | NULL |
+---------+------------+
And here is my query:
UPDATE numbers SET numb = numb ^ b'1';
And here is current output:
// numbers
+---------+------------+
| id | numb |
+---------+------------+
| int(11) | bit(1) |
+---------+------------+
| 1 | 0 |
| 2 | 0 |
| 3 | 1 |
| 4 | NULL |
+---------+------------+
And here is expected output:
// numbers
+---------+------------+
| id | numb |
+---------+------------+
| int(11) | bit(1) |
+---------+------------+
| 1 | 0 |
| 2 | 0 |
| 3 | 1 |
| 4 | 1 |
+---------+------------+
As you see, All I'm trying to do is making 1
the result of NULL ^ b'1'
. (current result is NULL
). How can I do that?