update更新记录
1.基础语法
UPDATE table_name SET column1 = value1, column2 = value2...., columnN = valueN WHERE [condition];
2.多表联合更新记录
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("乡镇名称",1)= left(B."乡(镇)",1) AND left("建制村名称",1)= left(B."村",1) AND "建制村人口" = '' AND "建制村名称" != '大村委会' AND "建制村名称" != '小村委会'
例2:
UPDATE "ZP1" A SET "通达路线编码" = B."通达路线编码" FROM "Z02" B WHERE A."乡镇名称" = B."乡镇名称" AND A."建制村名称"= B."建制村名称" AND A."通达路线编码" = ''
更多建议: