日期:2014-05-18  浏览次数:20529 次

webdiyer、LoveCherry、hchxxzx、hertcloud。来看看。求SQL语句
字段里面的数据如下:
金柏生物: <a   href=http://www.yy3721.com/zs/zs-detail.asp?id=11530   target= '_blank '   title= '单击进入 '> 威博士强劲胶囊 </a>  
河南竹林众: <a   href=http://www.yy3721.com/zs/zs-detail.asp?id=11527   target= '_blank '   title= '单击进入 '> 止咳橘红口服液 </a>  
北京益康: <a   href=http://www.yy3721.com/zs/zs-detail.asp?id=11801   target= '_blank '   title= '单击进入 '   class= 'style4 '> 破壁灵芝孢子粉 </a>  
江苏瑞家医药: <a   href=http://www.blogcn.com/foot/faq.asp?action=loginhelp   target= '_blank '   title= '单击进入 '   class= 'style4 '> 甲钴胺胶囊 </a>  
西安高新医药: <a   href=http://www.yy3721.com/zs/zs-detail.asp?id=11780   target= '_blank '   title= '单击进入 '   class= 'style4 '> 喜来劲 </a>  
陕西东泰制药: <a   href=http://www.yy3721.com/zs/zs-detail.asp?id=11761   target= '_blank '   title= '单击进入 '   class= 'style4 '> 盆炎净胶囊 </a>  
福州卓辉: <a   href=http://www.yy3721.com/zs/zs-detail.asp?id=11739   target= '_blank '   title= '单击进入 '   class= 'style4 '> 辰氏草本去屑洗剂 </a>  
济南正邦: <a   href=http://www.yy3721.com/zs/zs-detail.asp?id=11712   target= '_blank '   title= '单击进入 '   class= 'style4 '> 眼依系列护眼露 </a>  


我想把里面所有的字符都更新了,只保存ID号   这样的语句怎么写~~~

------解决方案--------------------
这个不是问过么?
------解决方案--------------------
这个是直接。让前台显示的连接 连到他的网站的。。

=============================================
我知道,我的意思是说

金柏生物: <a href=http://www.yy3721.com/zs/zs-detail.asp?id=11530 target= '_blank ' title= '单击进入 '> 威博士强劲胶囊 </a>

这个留 11530

河南竹林众: <a href=http://www.yy3721.com/zs/zs-detail.asp?id=11527 target= '_blank ' title= '单击进入 '> 止咳橘红口服液 </a>

这个留 11527

江苏瑞家医药: <a href=http://www.blogcn.com/foot/faq.asp?action=loginhelp target= '_blank ' title= '单击进入 ' class= 'style4 '> 甲钴胺胶囊 </a>

这个你打算留什么?

而且数据库里其他的数据是否也是这样没规律的?
------解决方案--------------------
字符串函数提取亚
------解决方案--------------------
我上次给你的回的是我测试过的,如果所有的记录都是id=XXXX ,是可以成功的

但你这里出来一个异类..
------解决方案--------------------
点名贴,没礼貌
特地进来BS下LZ
------解决方案--------------------
如果只有id=XXX这种格式,可以用这个
update 表
set 新id字段 = substring(老id字段,PATINDEX( '%?id=% ',老id字段) + 4,PATINDEX( '% " % ',老id字段)- PATINDEX( '%?id=% ',老id字段) - 4)
------解决方案--------------------
可以自己自定义一个函数马
create function 呵呵 然后把amandag(高歌) 的代码考进去
------解决方案--------------------
用C#正则来匹配
string str = @ "id=(? <yID> \d+) ";
------解决方案--------------------
顶!
------解决方案--------------------
sibyle(先知)

想听听c#正则