Update data in sql

0

I have the following code, I would like to know how to modify it to make an update to the data that I consult from the id_rol_tercero table, the table I want to update is called rol_por_tercero,

use NameDatabase
SELECT  
    rol_por_tercero.id_tercero, 
    rol_por_tercero.id_rol_tercero
FROM    
    rolprovedor 
INNER JOIN      
    rol_por_tercero 
ON  
    rolprovedor.id_tercero = rol_por_tercero.id_tercero
    
asked by Andrex_11 26.01.2018 в 15:13
source

1 answer

1

For MS SQL Server it would be:

UPDATE ROL
SET ROL.id_rol_tercero = 4 -- Valor a actualizar
FROM rol_por_tercero ROL
    INNER JOIN roprovedor PVR on PVR.id_tercero = ROL.id_tercero
--Si tienes un filtro adicional usa un WHERE aqui con la condicion
    
answered by 26.01.2018 / 15:41
source