I'm trying to update a name column from table test and update from column name2 from test2 table where another two column from both tables have to match.
It gives me error "single row query return multiple row".
How do I return multiple rows? Do I use a for loop? If so, how?
Update Test
SET name = (Select name2
from test2
where name2.col2 = name.col)
WHERE EXISTS
( SELECT name2
FROM test2
WHERE name2.col2 = name.col);
name2.col2andname.col, butnameandname2seem to be your column names, wile your table names are not used? Please try to fix your example...