update更新記錄

2018-08-30 15:54 更新

1.基礎語法

UPDATE table_name SET column1 = value1, column2 = value2...., columnN = valueN WHERE [condition];

2.多表聯(lián)合更新記錄

upate "A" set "A字段" = B."字段" from "B" where "A字段" = B."字段" 或

upate "A" set "A字段" = B."字段" from "B" where A."字段" = B."字段" 例1:

UPDATE "ZP01_copy" SET "建制村人口" = B."總人口數" , "自然村數量" = B."自然村數" FROM "WPS表格" B WHERE left("鄉(xiāng)鎮(zhèn)名稱",1)= left(B."鄉(xiāng)(鎮(zhèn))",1) AND left("建制村名稱",1)= left(B."村",1) AND "建制村人口" = '' AND "建制村名稱" != '大村委會' AND "建制村名稱" != '小村委會'

例2:

UPDATE "ZP1" A SET "通達路線編碼" = B."通達路線編碼" FROM "Z02" B WHERE A."鄉(xiāng)鎮(zhèn)名稱" = B."鄉(xiāng)鎮(zhèn)名稱" AND A."建制村名稱"= B."建制村名稱" AND A."通達路線編碼" = ''

以上內容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號