> -----Original Message-----
> Hi,
> i have a table with 2000 rows.
> One column (name answer)has a string ("ok --") in all the
> rows.(e.g "ok --
> yes we support this.").
> now i want to remove all these 'ok --' in this
> column..leaving(e.g yes we
> support this)
> I tried to do it with the replace query but being a newbie to mysql i
> couldnt find the right syntax.
> Can someone help.
>
> thanx and regards
> anil
This may help you
http://www.mysql.com/doc/S/t/String_functions.html
UPDATE table SET column = 'yes we support this.' WHERE column = 'ok -- yes we support
this.';
Or using functions
UPDATE table SET column = SUBSTRING(column,7) WHERE column LIKE 'ok --%';
that will remove 'ok -- ' from all strings starting with 'ok --'
---------------------------------------------------------------------
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