“Cara memperbarui beberapa baris di SQL” Kode Jawaban

SQL Perbarui beberapa tabel

/*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.*/


BEGIN TRANSACTION;

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;
https://aybee.codes

Cara memperbarui beberapa baris di SQL

update with in condition
Victorious Vulture

Jawaban yang mirip dengan “Cara memperbarui beberapa baris di SQL”

Pertanyaan yang mirip dengan “Cara memperbarui beberapa baris di SQL”

Lebih banyak jawaban terkait untuk “Cara memperbarui beberapa baris di SQL” di Sql

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya