Presta atención porque en esta crónica vas a encontrar el arreglo que buscas.
Ejemplo 1: actualizar varias columnas en sql
UPDATEtable-name SETcolumn-name =value,column-name =valueWHERE condition =value
Ejemplo 2: actualizar tabla sql conjunto múltiple
-- CANT do multiple sets but can do caseUPDATEtableSET ID =CASEWHEN ID =2555THEN111111259WHEN ID =2724THEN111111261WHEN ID =2021THEN111111263WHEN ID =2017THEN111111264ENDWHERE ID IN(2555,2724,2021,2017)
Ejemplo 3: consulta de actualización para varias columnas
UPDATE Person.Person
Set FirstName ='Kenneth',LastName ='Smith'WHERE BusinessEntityID =1
Ejemplo 4: sql actualiza varias tablas
/*You can't update multiple tables in one statement,
however, you can use a transaction to make sure that
two UPDATE statements are treated atomically.
You can also batch them to avoid a round trip.*/BEGINTRANSACTION;UPDATE Table1
SET Table1.LastName ='DR. XXXXXX'FROM Table1 T1, Table2 T2
WHERE T1.id = T2.id
and T1.id ='011008';UPDATE Table2
SET Table2.WAprrs ='start,stop'FROM Table1 T1, Table2 T2
WHERE T1.id = T2.id
and T1.id ='011008';COMMIT;
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)