Rank: Advanced Member Groups: Member
Joined: 1/31/2008 Posts: 31 Points: 93 Location: UK
|
hi guys
i 'm having problem in searching and replacing text in specific field. well i know about mysql update command and have lookup up regexp but not solved. typical data is : abcQFxyz to chnage to abcQFIxyz.
I got as far as: UPDATE mytable SET myfield = QFI WHERE part_number REGEXP 'QF'; but I know that wrong.
Thanks for your help.
|
Rank: Advanced Member Groups: Member
Joined: 3/3/2008 Posts: 78 Points: 234 Location: India
|
manzor wrote:hi guys
i 'm having problem in searching and replacing text in specific field. well i know about mysql update command and have lookup up regexp but not solved. typical data is : abcQFxyz to chnage to abcQFIxyz.
I got as far as: UPDATE mytable SET myfield = QFI WHERE part_number REGEXP 'QF'; but I know that wrong.
Thanks for your help.
try this code Code:UPDATE `table_name` SET `field_name` = REPLACE(field_name, 'QF', 'GFI')
|