sql批量修改
阿新 • • 發佈:2018-12-12
前言: 使用left join得到的時間格式,匯入導ecxel中出錯,然後就考慮用批量修改的方法
步驟:
1.excel中設定好修改資料
2.複製導notepad 空格多少無所謂
UPDATE bi_manu SET dept_id = CASE dept_id WHEN 43 THEN 298 WHEN 45 THEN 301 WHEN 48 THEN 303 WHEN 39 THEN 304 WHEN 46 THEN 305 WHEN 1 THEN 310 WHEN 2 THEN 311 WHEN 3 THEN 312 WHEN 4 THEN 313 WHEN 6 THEN 314 WHEN 5 THEN 315 WHEN 7 THEN 316 WHEN 9 THEN 317 WHEN 8 THEN 318 WHEN 11 THEN 319 WHEN 10 THEN 320 WHEN 13 THEN 321 WHEN 14 THEN 322 WHEN 15 THEN 323 WHEN 16 THEN 324 WHEN 17 THEN 325 WHEN 18 THEN 326 WHEN 19 THEN 327 WHEN 21 THEN 329 WHEN 22 THEN 330 WHEN 23 THEN 331 WHEN 24 THEN 332 WHEN 25 THEN 333 WHEN 26 THEN 334 WHEN 28 THEN 335 WHEN 27 THEN 336 WHEN 29 THEN 337 WHEN 31 THEN 338 WHEN 32 THEN 339 WHEN 37 THEN 342 WHEN 34 THEN 343 WHEN 30 THEN 344 WHEN 12 THEN 356 WHEN 20 THEN 328 WHEN 36 THEN 341 WHEN 44 THEN 309 WHEN 38 THEN 306 WHEN 35 THEN 340 WHEN 42 THEN 425 WHEN 47 THEN 307 WHEN 33 THEN 297 WHEN 40 THEN 279 WHEN 41 THEN 296 END