MySQL Forums
Forum List  »  Newbie

How to update a group of entries
Posted by: Bob Wilson
Date: October 19, 2006 06:33PM

A table has a group of items that have unique entries for images. But the image is really the same for each group so I need to rename those. So a table entry might look like
table products {
and the data would be

name = a1 image - a-1.jpg
name = a2 image - a-2.jpg
name = a3 image - a-3.jpg
name = b4 image - b-4.jpg
name = b5 image - b-5.jpg
name = b6 image - b-6.jpg

I want it to end up being

name = a1 image - a.jpg
name = a2 image - a.jpg
name = a3 image - a.jpg
name = b4 image - b.jpg
name = b5 image - b.jpg
name = b6 image - b.jpg

I was thinking to use the update command but can't see what to put in the set option:
update products set image=??? where image like '%-%.jpg'

If it were just one group, I could just put the image name in it. But there are about 9,000 products so I need something automatic. Would someone please explain how to do this?

Options: ReplyQuote

Written By
How to update a group of entries
October 19, 2006 06:33PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.