0|0|0|0|0|0|0|0|0|0|0|0|0|0|1|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|12|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|3|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|6|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0
我想成批的替换里面的1为66,3为77,6为88,12为99,其他不变,请问该怎么写sql语句?
另外:我想在后面增加几个|0|0|0|0|0|0|0|0|0,写sql语句能实现吗?
谢谢!!
3 个解决方案
#1
你这是要替换字段里面的部分内容呀,
#2
http://www.cnblogs.com/ATree/archive/2010/07/07/Sql-Serve-REPLACE.html
#3
直接repalce这个就可以实现
replace(str,"|1|","|66|")
replace(str,"|1|","|66|")
#1
你这是要替换字段里面的部分内容呀,
#2
http://www.cnblogs.com/ATree/archive/2010/07/07/Sql-Serve-REPLACE.html
#3
直接repalce这个就可以实现
replace(str,"|1|","|66|")
replace(str,"|1|","|66|")