首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

SQL 比较棘手的有关问题

2012-09-23 
SQL 比较棘手的问题已知我有一个表中的某一个字段inputfromsql 都有一个where 关键字 现在我想用where关键

SQL 比较棘手的问题
已知我有一个表中的某一个字段inputfromsql 都有一个where 关键字 现在我想用where关键字替换为 where a.state=1 and 

 是这个字段的所有都替换, 求支招 啊。

[解决办法]

SQL code
update tb set inputfromsql=replace(inputfromsql,' where ',' where a.state=1 and ')
[解决办法]
SQL code
--不知道你的字段需要格式下不?你确认全部替换的话,先执行看这个语句报错不update tb set inputfromsql=replace(inputfromsql,N'where',N'where a.state=1 and')
[解决办法]
SQL code
update tb set inputfromsql=replace(inputfromsql,' where ',' where a.state=1 and ') 

热点排行