Reputation: 89
I have a record like Z Ion Fort
. Now I want to combine the word like as follows ZIon Fort
,for that I had written a update query like
update sample1 set sname=replace(sname,' Ion ','Ion ');
But it is not working.
Upvotes: 0
Views: 1472
Reputation: 5050
MySQL 5.5.32 Schema Setup:
CREATE TABLE sample1
(`sname` varchar(36))
;
INSERT INTO sample1
(`sname`)
VALUES
('Z Ion Fort Z Butol (800 mg)')
;
update sample1 set sname=replace(sname,'Z ','Z');
Query 1:
select *
from sample1
| SNAME |
|---------------------------|
| ZIon Fort ZButol (800 mg) |
Upvotes: 2