*********.php?haode=yes********789**********
*********.php?haode=yes********246**********
*********.php?haode=yes********221**********
*********.php?haode=yes********687**********
*********.php?haode=yes********215**********
需要替换成
*********.php?type=789********789**********
*********.php?type=246********246**********
*********.php?type=221********221**********
*********.php?type=687********687**********
*********.php?type=215********215**********
回复讨论(解决方案) ?abc替1,2,3
update table set fields = replace(fields, 'abc', '123');
?abc替1,2,3
update table set fields = replace(fields, 'abc', '123');
我主要是要把后面的哪数字复制到前面来呀 update tbl_name set field=replace(field, 'haode=yes', concat('type=', substring_index(substring_index(field, '', 1), '', -1))
update tbl_name set field=replace(field, 'haode=yes', concat('type=', substring_index(substring_index(field, '', 1), '', -1))
#1064 - you have an error in your sql syntax; check the manual that corresponds to your mysql server version for the right syntax to use near '' at line 2
.... , -1)) )
少粘了一层括号
update tbl_name set field=replace(field, 'haode=yes', concat('type=', substring_index(substring_index(field, '', 1), '', -1))
可以给份完整代码吗,真心不懂sql语句
数据库doudou
表名phome_ecms_news_data_1
字段newstext
.... , -1)) )
少粘了一层括号
搞定了,非常感谢