update更新记录

2018-08-30 15:54 更新

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."通达路线编码" = ''

以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号