Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
outspaced
Starting Member
21 Posts |
Posted - 2007-02-23 : 07:59:44
|
| 3 tables - products, titles and imagesproducts includes titleid and imageid.products.titleid = titles.titleidproducts.imageid = images.imageidIn the table images I have the fields imagesource and imageid - the imagesource field includes the cataloguenumber of the title I want to match the image to.I want to update the table products so that the field products.imageid matches images.imageid for the entry where images.imagesource is like titles.cataloguenumber. Any suggestions?Cheers,Alex |
|
|
mwjdavidson
Aged Yak Warrior
735 Posts |
Posted - 2007-02-23 : 08:17:31
|
| [code]UPDATE pSET p.ImageID = i.ImageIDFROM dbo.Products AS pJOIN dbo.Titles AS tON p.TitleID = t.TitleIDJOIN dbo.Images AS iON i.ImageSource LIKE '%' + t.CatalogueNumber + '%' [/code]Mark |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-02-23 : 08:17:36
|
this ?update pset imageid = i.imageidfrom products p inner join titles t on p.titleid = t.titleid inner join images i on i.imagesource = t.cataloguenumber KH |
 |
|
|
|
|
|