[thelist] [mysql] + operator (solved)

rudy r937 at interlog.com
Sun Feb 2 19:26:01 CST 2003


> I had a dicky duplicate db record

but...  but... you selected the row to update using a WHERE condition on id

isn't id a primary key?  does your table have a primary key?

perhaps that explains why you have LIMIT 1 in an UPDATE statement

this is a mysql proprietary extension, which, i grant, might have legitimate
application (several of mysql's inventions are rather useful), but not when
you are selecting based on a primary key

i find that a lot of mysql's proprietary stuff is counter-intuitive to the
way a logical relational database person would normally expect

e.g. "having trouble with duplicate rows?  no problem, just limit your
update statement to 1 row"

if you were updating based on a non-unique column, let's say department,
with multiple employees in a department, and you decide to update the
hours of all employees where dept=21 but you include, by force of habit,
your friend the LIMIT 1 clause... which employee did you update?

yikes


rudy




More information about the thelist mailing list