PDA

View Full Version : need help in update query


developer
08-18-2007, 01:33 PM
Hello

I want to update some records and want to delete some characters from the string in data base like

This is my first query

I want to write a update query to update all records where the substring "my" is found and delete it from the string then the resulting string becomes

This is query

any suggestion

abduraooft
08-18-2007, 02:20 PM
update [table_name] set [field_name] = replace([field_name],'[string_to_find]','[string_to_replace]');

Obtained from http://benmetcalfe.com/blog/index.php/2004/11/21/mysql_replace_is_your_friend/

In your case '[string_to_find]' => 'my'
and '[string_to_replace]' =>''

developer
08-18-2007, 03:04 PM
Thankyou so much its all done.