I have a table with client data, with the fields 'name_name' and 'code_name'.
I need to update the 'codcorretor' from the data of my user table, where I have 'name' and 'codusuario'.
So that something like codcorretor=codusuario where nomecorretor=nome
I tried to do this but it did not roll:
update clientes set cli.codcorretor=us.codusuario
inner join usuario us on cli.nomecorretor=us.nome
where us.codusuario in (select codusuario from usuario);
Can anyone help me?
Thank you.