Update specific records of MySQL table

前端 未结 5 1338
没有蜡笔的小新
没有蜡笔的小新 2021-01-13 00:41

I am dealing with phone system and have to work with multiple service vendors. For one vendor I have a MySQL table country_codes like this -

--         


        
5条回答
  •  礼貌的吻别
    2021-01-13 01:36

    Try this query -

    UPDATE country_codes
    SET country_code := @c := IF(@c IS NOT NULL AND country_code = 0, @c, country_code)
    ORDER BY CAST(area_code AS CHAR)
    

提交回复
热议问题