On 10 Jul 2002, at 12:13, Anil Garg wrote:

> 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.

You don't want a REPLACE *query* -- you want to use an UPDATE query 
with the REPLACE *function*.  The two have nothing to do with each 
other.  Have you looked at the documentation?

http://www.mysql.com/doc/U/P/UPDATE.html
http://www.mysql.com/doc/S/t/String_functions.html

So you seem to want something like

   UPDATE table_name SET answer = REPLACE(answer, 'ok -- ', '');


-- 
Keith C. Ivey <[EMAIL PROTECTED]>
Tobacco Documents Online
http://tobaccodocuments.org

---------------------------------------------------------------------
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