MyBB Community Forums

Full Version: UPDATE & JOIN
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi

UPDATE City SET CountryName = ( SELECT Pais
FROM City
INNER JOIN Country ON CountryCode = Code )

Say me, than not is possible put a select into a update, the which is obvious, just I want test

SELECT Pais as MiPais FROM City
INNER JOIN Country
ON CountryCode=Code UNION UPDATE City SET CountryName = MiPais;

In this case, say me, I am having a problem with my sintax

What is the correct way to do it?
I solved this issue, The solution was

UPDATE City INNER JOIN Country
ON CountryCode = Code
SET CountryName = Name