表:maliya_c_news
字段:content以下(代码)内容是content字段中其中一小部分内容我想把这段代码批量去掉(删除),并不是把content字段中的内容全部去掉 需要去掉的内容如下:
<p style=\"text-align: center\"><an style=\"color: #ff6600\"><strong>[ 目前杭州玛丽亚医院妇科医院有一系列的优惠活动,凭预约号可直接减免一定的费用。]</strong></an></p>\r\n<p style=\"text-align: center\"><an style=\"color: #ff6600\"><strong><an style=\"color: #ff0000\">>>点击获取预约号<<</an> <strong><font color=\"#1f3a87\">>>点击查看公交车路线<<</font></strong></strong></an></p>\r\n<p style=\"text-align: center\">杭州玛丽亚医院的地址在:杭州市文三路6541号</p>
谢谢!!!
字段:content以下(代码)内容是content字段中其中一小部分内容我想把这段代码批量去掉(删除),并不是把content字段中的内容全部去掉 需要去掉的内容如下:
<p style=\"text-align: center\"><an style=\"color: #ff6600\"><strong>[ 目前杭州玛丽亚医院妇科医院有一系列的优惠活动,凭预约号可直接减免一定的费用。]</strong></an></p>\r\n<p style=\"text-align: center\"><an style=\"color: #ff6600\"><strong><an style=\"color: #ff0000\">>>点击获取预约号<<</an> <strong><font color=\"#1f3a87\">>>点击查看公交车路线<<</font></strong></strong></an></p>\r\n<p style=\"text-align: center\">杭州玛丽亚医院的地址在:杭州市文三路6541号</p>
谢谢!!!
set content=Replace(content,'<p style=\"text-align: center\"><an style=\"color: #ff6600\"><strong>[ 目前杭州玛丽亚医院妇科医院有一系列的优惠活动,凭预约号可直接减免一定的费用。]</strong></an></p>\r\n<p style=\"text-align: center\"><an style=\"color: #ff6600\"><strong><an style=\"color: #ff0000\">>>点击获取预约号<<</an> <strong><font color=\"#1f3a87\">>>点击查看公交车路线<<</font></strong></strong></an></p>\r\n<p style=\"text-align: center\">杭州玛丽亚医院的地址在:杭州市文三路6541号</p>','');
可是怎么执行了之后<p style=\"text-align: center\"><an style=\"color: #ff6600\"><strong>[ 目前杭州玛丽亚医院妇科医院有一系列的优惠活动,凭预约号可直接减免一定的费用。]</strong></an></p>\r\n<p style=\"text-align: center\"><an style=\"color: #ff6600\"><strong><an style=\"color: #ff0000\">>>点击获取预约号<<</an> <strong><font color=\"#1f3a87\">>>点击查看公交车路线<<</font></strong></strong></an></p>\r\n<p style=\"text-align: center\">杭州玛丽亚医院的地址在:杭州市文三路6541号</p>这些依然还存在啊?
参考一下这个贴子的提问方式http://topic.csdn.net/u/20091130/20/8343ee6a-417c-4c2d-9415-fa46604a00cf.html
1. 你的 create table xxx .. 语句
2. 你的 insert into xxx ... 语句
3. 结果是什么样,(并给以简单的算法描述)
4. 你用的数据库名称和版本(经常有人在MS SQL server版问 MySQL)
这样想帮你的人可以直接搭建和你相同的环境,并在给出方案前进行测试,避免文字描述理解上的误差。
mysql> select replace('123<p style=\"text-align: center\"><an style=\"color: #ff
6600\"><strong>[ 目前杭州玛丽亚医院妇科医院有一系列的优惠活动,凭预约号可直接减
免一定的费用。]</strong></an></p>\r\n<p style=\"text-align: center\"><an style=\
"color: #ff6600\"><strong><an style=\"color: #ff0000\">>>点击获取预约号<<</an>
<strong><font color=\"#1f3a87\">>>点击查看公交车路线<<</font></strong></strong
></an></p>\r\n<p style=\"text-align: center\">杭州玛丽亚医院的地址在:杭州市文三
路6541号</p>'
->
-> ,'<p style=\"text-align: center\"><an style=\"color: #ff6600\"><strong>[
目前杭州玛丽亚医院妇科医院有一系列的优惠活动,凭预约号可直接减免一定的费用。]</s
trong></an></p>\r\n<p style=\"text-align: center\"><an style=\"color: #ff6600\">
<strong><an style=\"color: #ff0000\">>>点击获取预约号<<</an> <strong><font co
lor=\"#1f3a87\">>>点击查看公交车路线<<</font></strong></strong></an></p>\r\n<p s
tyle=\"text-align: center\">杭州玛丽亚医院的地址在:杭州市文三路6541号</p>'
->
-> ,'')
-> ;
+-------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-------------------+
| replace('123<p style=\"text-align: center\"><an style=\"color: #ff6600\"><stro
ng>[ 目前杭州玛丽亚医院妇科医院有一系列的优惠活动,凭预约号可直接减免一定的费用
。]</strong></an></p>\r\n<p style=\"text-align: center\"><an style=\"color: #ff6
600\"><strong><an s |
+-------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-------------------+
| 123
|
+-------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-------------------+
1 row in set (0.00 sec)mysql>
我在这个字符串前面加个123,然后替换空后,得到的是123。
检查下你的代码。
zuoxingyu
难道是我代码的问题吗?
MySQL 中文显示乱码