滨海县卫生局:求批量替换的SQL语句(内详)

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/29 08:37:31
我要将某一表内的某一字段前后批量加入一些标志,例如将表"Dv_board"中的字段"Boardtype"中的"图片资源""软件下载"等变为"※图片资源※""※软件下载※" 要用什么语句呢? 谢谢

用下面这个就可以批量更新了
update Dv_board set Boardtype =replace(replace(Boardtype,"图片资源","※图片资源※"),"软件下载","※软件下载※")

update Dv_board set Boardtype = '※软件下载※' where Boardtype = '软件下载'

update 格式:

update 数据表 set 字段名=字段值 where 条件表达式"sql="update 数据表 set 字段1=值1,字段2=值2 …… 字段n=值n where 条件表达式

update Dv_board set Boardtype = '※'&Boardtype&'※'