UPDATE 表名称 SET 列名称 = 新值 WHERE 列名称 = 某值
例子 :
select student as s set s.age =13 where s.id =1
UPDATE table1 ,table2.... SET table1.name =value,table2.name=value..... WHERE table1.id =idValue and table2.id =idValue
例子 :
update test1,test2 set test1.name=test2.name,test1.age=test2.age where test1.id=test2.id
我业务用到的例子:
UPDATE cem_tower_mast_check tmc, cem_location_check AS l, cem_engineering_sum AS xuni, cem_engineering_sum AS eng SET tmc.latitude = l.latitudes, tmc.longitude = l.longitude WHERE eng.order_mun = '1221071910192889' AND eng.id = tmc.engineering_sum_id AND xuni.order_mun = 'DD20210721YCYD010293' AND xuni.id = l.engineering_sum_id