Hi,,

The Update query of yours will do fine..
otherwise try using string functions [instr()] like

mysql> update inventory_items set name='necklace' where instr(description,'necklace')>0;

Thanks
ViSolve DB Team.
----- Original Message ----- From: "Jerry Jones" <[EMAIL PROTECTED]>
To: <mysql@lists.mysql.com>
Sent: Saturday, February 03, 2007 8:42 AM
Subject: Update query question


I am new to mysql. I am trying to do a simple update query to update a
field based on the contents of another field in the same table.
Here is what I have.
update inventory_items set name = "necklace" where description like
"%necklace%";
I am not sure what is wrong. select * from inventory_items where
description like "%necklace%"; works just fine. I cannot find much
online to help me out with this.
To summarize, I need to update the name field to "necklace" when the
word necklace shows up anywhere in the description field.
Thanks.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to