stevelionbird
Programmer
Hi everyone,
I'm looking for a way with one statement to change the value of a tinyint field (named 'is_archive') in a table to either:
zero if its current value is one
OR
one if its current value is zero
Is there a way to do this without having to first query the table to get the current value of 'is_archive'?
e.g.
Thanks in advance,
Steve
I'm looking for a way with one statement to change the value of a tinyint field (named 'is_archive') in a table to either:
zero if its current value is one
OR
one if its current value is zero
Is there a way to do this without having to first query the table to get the current value of 'is_archive'?
e.g.
Code:
update [i]table[/i] set is_archive = (is_archive = 1) ? 0 : 1 where [i]conditions[/i];
Thanks in advance,
Steve