UPDATE tablename SET columnname = substring(columnname, 1, if
(locate('string', columnname) > 0, locate('string', columnname) - 1,
length(columnname)));

> Hi,
>
> I have a database column of char(250); I can insert enmass a string
> into said column using:
>
> update tablename set columnname = concat(columnname, 'string');
>
> but how do I undo that?
>
> Is there a function that is exactly the reverse of concat such
> that:
>
> update tablename set columnname = unconcat(columnname, 'string');
> will actually delete 'string' pattern from columnname?


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to