id name age
1 name_张三 90
2 name_李四 33
3 name_王五 32
....
有很多很多
现在要求把name_都用""替换,这sql语句改怎么写,谢谢各位了
1 name_张三 90
2 name_李四 33
3 name_王五 32
....
有很多很多
现在要求把name_都用""替换,这sql语句改怎么写,谢谢各位了
解决方案 »
- 那么多的双引号。。。
- 一个struts2的问题,请高手解答!
- NetBeans 关于GUI设计的问题
- Null?NO!But Why?
- 一道java题目,等待中
- MDB is unable to connect to jms destination, Foreign Destinati
- Hibernate异常:found two representations of same collection
- 紧急求救--国内那里有JBoss的镜像站点下载?
- tomcat5.5怎么配置全局 jndi???
- 寻求jboss-boot.jar和servlet.jar,好心人帮帮忙吧
- 哪个for循环更快?为什么?
- javax.faces.FacesException: The scope of the referenced object: #{agsMap} is sho
1.replace into
replace into table (id,name) values('1','aa'),('2','bb')
此语句的作用是向表table中插入两条记录。如果主键id为1或2不存在就相当于
insert into table (id,name) values('1','aa'),('2','bb')
如果存在相同的值则不会插入数据2.replace(object,search,replace)
把object中出现search的全部替换为replace
select replace('www.163.com','w','Ww')--->WwWwWw.163.com
例:把表table中的name字段中的aa替换为bb
update table set name=replace(name,'aa','bb')3.UPDATE更新一个字段中的的部分内容现在有一条记录的字段是“abcdefg",现在我只想将该字段中的c改为C,update语句应该怎么写update 表名 set 字段1 = replace(字段1,'c','C')
MSSQL 可以使用游标的系统存储过程 sp_MSforeach_Worker 处理
update table set name = replace(name,'name_','') where name like 'name_%';--替换 update table set name = substr(name,6) where name like 'name_%'; --截取
replace into mytable (name) VALUES('name_','') where id = 3update mytable set name = replace(name,'name_','') where id = 3警告:--->
W (1): Index id 2 on table id 1978487096 cannot be used in the optimization of a query as it is SUSPECT. Please have the SA run DBCC REINDEX on the specified table.
<---
已选定 1 条记录 [抓取元数据:0ms] [抓取数据:0ms] [已执行:11-3-16 上午10时27分59秒] [执行:16ms] >[错误] 脚本行:9-9 ---------------------------------------
Incorrect syntax near the keyword 'replace'.
消息: 156, 级别: 15, 状态: 2
服务器: DM9WS9N6G65, 行: 1 [已执行:11-3-16 上午10时28分26秒] [执行:0ms]