MYSQL Update Query 删除部分 Sting
尝试删除字符串的一部分,如下所示
#Crawlers_Album_The_Mess_We_Seem_To_Make #Crawlers<br><br>[center][url="https://www.databasedreams.co.uk/charts/index.php?action=gallery;sa=view;id=35847"]
#Crawlers_Album_The_Mess_We_Seem_To_Make #Crawlers<br><br>[center][url="https://www.databasedreams.co.uk/charts/index.php?action=gallery;sa=view;id=35847"][img]https://www.databasedreams.co.uk/charts/gallery/35/medium_1-270224213050-35846450.jpeg[/img][/url]<br>[music_rawards id=-2028986475]Awards[/music_rawards][/center]<br><br> Released: [color=pink][size=2]16 February 2024[/size][/color]<br> Cat no: [color=pink][size=2]5827488[/size][/color]<br> Album Type: [color=pink][size=2]Studio Album[/size][/color]<br><br>[music_rinfo id=-2028986475]Info[/music_rinfo]<br>[music_rstats id=-2028986475]Stats[/music_rstats]
试过了,但搞砸了,清空了场地
UPDATE `database_messages`
SET `body`= RIGHT(`body`, INSTR(`body`,'][img]')+1)
WHERE `id_board` = 128 and INSTR(`body`,'][img]');
我希望删除包含的字符串的第一部分,以便帖子看起来应该像这样[img]
[img]https://www.databasedreams.co.uk/charts/gallery/35/medium_1-270224213050-35846450.jpeg[/img][/url]<br>[music_rawards id=-2028986475]Awards[/music_rawards][/center]<br><br> Released: [color=pink][size=2]16 February 2024[/size][/color]<br> Cat no: [color=pink][size=2]5827488[/size][/color]<br> Album Type: [color=pink][size=2]Studio Album[/size][/color]<br><br>[music_rinfo id=-2028986475]Info[/music_rinfo]<br>[music_rstats id=-2028986475]Stats[/music_rstats]
在我打算运行 replace for 之后,它会删除该部分的[/img][/url][/url]