Is it possible to delete certain “text” from database which is not static?
For static text I simply replaced “static text” with “”.
Actually I just need a command which will delete “static text1 * static text2”
So everything from text1 to text2.
Text1 and text2 is static, but everything between changes.
Thanks for help
If I understand correctly, you want to
UPDATEa text-value in a table to remove any text that’s betweentext1andtext2, but leave the actual row in-tact.If that’s the case, you can use a combination of
SUBSTRING()andLOCATE()to perform theUPDATE:This will take the first part of the
fieldcolumn up-to the text “text1” (and including thetext1text itself), then will take a second sub-string from thefieldcolumn for everything after (and including) thetext2text.If you want to “change” the text in-between these two values, for instance say you have
text1 some-value text2and you want it to becometext1 new-thing text2, you could use the above query and put the new text in the middle: