0

I need replace values

Table dict_title
Column1 ENG - Column2 FIN
white       -    valkoinen
black       -    musta
2000+ words for replace

Table new_products
Column content
white phone
black phone
about 10000 records

Now i try do this query

UPDATE new_products , dict_title 
SET new_products.title = 
REPLACE (new_products.title, dict_title.eng, dict_title.fin)

But this query handle only first line of dict_title table. How i can do replace from all table?

Thank you

Strawberry
  • 33,750
  • 13
  • 40
  • 57
user2421781
  • 399
  • 2
  • 5
  • 16
  • are you joining `new_products` and `dict_title` at all? this is how you can write an `update` using two tables... it says mssql 2005 but it will work for mysql, too: [link](http://stackoverflow.com/questions/2044467/how-to-update-two-tables-in-one-statement-in-sql-server-2005) – gloomy.penguin Aug 30 '13 at 16:19
  • How i can join? That tables doesnt have similiars id or something else... – user2421781 Aug 30 '13 at 16:24
  • Oh, then I don't understand your problem... maybe. So....... for `new_products.title`, are you trying to replace every occurrence of `dict_title.eng` with its corresponding value of `dict_title.fin`? – gloomy.penguin Aug 30 '13 at 16:27
  • The last query what worked i wrote. Could you write example what i can try more? – user2421781 Aug 30 '13 at 16:30
  • At this point, I'm not even sure what you are trying to do... I personally don't know how to do what I think you want to do without a stored procedure or running the same query multiple times. Can you clarify what you want and if a stored procedure is an option? – gloomy.penguin Aug 30 '13 at 16:44

0 Answers0