sql:select context from list where context like '%
http://pic.jinti.com/member/%'
查询的结果:
id context
1 我是中佃人[color1=#ff1493]
[img1]http://pic.jinti.com/member/2874357/2009610121416774.jpg[/img1][/color1]
2 粗体http://pic.jinti.com/member/73/20096810374579.jpg是吗?http://pic.jinti.com/member/342342/200941210374579.jpg测试 要求更新成:
id context
1 我是中佃人[color1=#ff1493]
[img1]http://pic.jinti.com/album/20090610/2009610121416774.jpg[/img1][/color1]
2 粗体http://pic.jinti.com/album/20090610/20096810374579.jpg是吗?http://pic.jinti.com/album/20090412/200941210374579.jpg测试
注:http://pic3.jinti.com/album/和http://pic.jinti.com/member/是固定的
需要将7326419/20096810374579.jpg
更换成20090608/20096810374579.jpg
7326419是用户ID,更新成20096810374579.jpg文件名的前面的年月日20090608
http://pic.jinti.com/member/%'
查询的结果:
id context
1 我是中佃人[color1=#ff1493]
[img1]http://pic.jinti.com/member/2874357/2009610121416774.jpg[/img1][/color1]
2 粗体http://pic.jinti.com/member/73/20096810374579.jpg是吗?http://pic.jinti.com/member/342342/200941210374579.jpg测试 要求更新成:
id context
1 我是中佃人[color1=#ff1493]
[img1]http://pic.jinti.com/album/20090610/2009610121416774.jpg[/img1][/color1]
2 粗体http://pic.jinti.com/album/20090610/20096810374579.jpg是吗?http://pic.jinti.com/album/20090412/200941210374579.jpg测试
注:http://pic3.jinti.com/album/和http://pic.jinti.com/member/是固定的
需要将7326419/20096810374579.jpg
更换成20090608/20096810374579.jpg
7326419是用户ID,更新成20096810374579.jpg文件名的前面的年月日20090608
解决方案 »
- 为什么存储过程不能执行
- 咨询点关于手机上网的问题
- 如何隐藏repeater控件的特定一个列?
- 请教高手,用户登陆问题!
- 【散分】在ASP.NET中用三个DropDownList控件方便的选择年月日【原创】
- Extjs tabpanel中佈局問題
- 求人帮忙 扩展思路 我只用过ajax 登陆和AjaxControlToolkit 大家所说的学习ajax是学这两点吗? 用ajax如何判断数据库里是否存在 **数据呢
- 如何在程序的点击事件中弹出对话筐让用户选择?
- 在ASP。NET中是否可以取得刚插入数据的ID号。如果可以,怎样实现???
- 我如何在ASP.NET(C#)中使用VBA呢?
- 两个关于Treeview的问题
- 关于ASP。NET多核的问题
http://pic.jinti.com/member/%'
查询的结果:
id context
1 我是中佃人[color1=#ff1493]
[img1]http://pic.jinti.com/member/2874357/2009610121416774.jpg[/img1][/color1]
2 粗体http://pic.jinti.com/member/73/20096810374579.jpg是吗?http://pic.jinti.com/member/342342/200941210374579.jpg测试 要求更新成:
id context
1 我是中佃人[color1=#ff1493]
[img1]http://pic.jinti.com/album/20090610/2009610121416774.jpg[/img1][/color1]
2 粗体http://pic.jinti.com/album/20090610/20096810374579.jpg是吗?http://pic.jinti.com/album/20090412/200941210374579.jpg测试
注:http://pic.jinti.com/album/和http://pic.jinti.com/member/是固定的
需要将7326419/20096810374579.jpg
更换成20090608/20096810374579.jpg
7326419是用户ID,更新成20096810374579.jpg文件名的前面的年月日20090608可以用sql执行、也可以用net代码结合正则实现
20096810374579提取这段数字的日期,月份又没有06 ,只是一个6 。
c#:可以把contex用split按照/来分割,保存在一个数组,提取这个数组的第四和第五个内容,用left(20096810374579.jpg,6)替换掉第四个内容,再组合这些字符串,保存回数据库。
http://pic.jinti.com/member/%'
再调用自定义函数,获取/member/后内容,替换内容,再修改。
update table set context=replace(context,'7326419/20096810374579.jpg','20090608/20096810374579.jpg')
它标示的是2009年12月12日?还是2009年1月2日?还是2009年12月1日?还是2009年1月21日?
可以在.net里替换也可以在sql上下功夫
这样不是也可以