I've got a table that looks like this:
create table comment (
id varchar(48) not null primary key,
entryid varchar(48) not null,
name varchar(255) null,
email varchar(255) null,
url varchar(255) null,
content text null,
posttime timestamp not null,
spam bit default 0 not null,
remotehost varchar(128) null
);
And I want to set the spam field in all rows to false like so:
update comment set spam=false;But that command also resets all of the posttime fields in the table to the current time. If I use the following command, my posttime fields are preserved.
update comment set spam=false, posttime=posttime;What's up with that? Why does an update of one field affect other fields?
This work is licensed under a Creative Commons License.
Copyright 2002-2007, David M Johnson (dave.johnson at rollerweblogger.org)
This is a personal weblog, I do not speak for my employer.

Buy now from Amazon.com
Or direct from Manning
| « August 2008 | ||||||
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|---|---|---|---|---|---|
1 | ||||||
3 | 5 | 6 | 7 | 9 | ||
10 | 12 | 14 | 15 | 16 | ||
17 | 19 | 20 | 21 | 22 | 23 | |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 | ||||||
| Today | ||||||
Allen Gilliland
Anil Gangolli
Dan Axon
Danese Cooper
Film Babble Blog
Geertjan's Weblog
Henri Yandell
James Robertson
Jim Grisanzio
Josh Staiger
Linda Skrocki
Pat Chanezon
Rama
Ruby Sinreich
Simon Phipps
Tim Bray
Will Snow
Janne Jalkanen
Joe Gregorio
Matt Raible
Mike Cannon Brookes
Rafe Colburn
Sam Ruby
Simon Brown
My other sites
Posted by John Beimler on May 29, 2004 at 09:11 AM EDT #
Posted by Dave Johnson on May 29, 2004 at 09:26 AM EDT #
Posted by Koz on May 30, 2004 at 05:19 PM EDT #
Posted by Vinicios Torres on May 31, 2004 at 09:19 AM EDT #