通过检查两列数据来更新mysql

时间:2015-03-11 17:10:07

标签: mysql

UPDATE city_final SET city_final.distance=500000, where city_final.fromcountryID =1 and city_final.tocountryID!=1

我想通过检查列中的distance =500000来更新countryID 什么是thids查询的错误

1 个答案:

答案 0 :(得分:3)

city_final.distance=500000

之后删除逗号
UPDATE city_final 
SET city_final.distance=500000
where city_final.fromcountryID =1 and city_final.tocountryID!=1