Hulk
Hulk

Reputation: 34200

update replace command in mysql

All,

In a field named(path) in The table named is recn i have the follwoing data /home/user1/Computer-Science-10_1-10_7-17//html/Compu.html

how do i replace

/home/user1/Computer-Science-10_1-10_7-17//html/Compu.html with /home/user1/path/files/Computer-Science-10_1-10_7-17//html/Compu.html in mysql

Also There are many rows like /home/user1 which i have to replace with /home/user1/path/files

Thanks.....

Upvotes: 0

Views: 1306

Answers (1)

Max Shawabkeh
Max Shawabkeh

Reputation: 38663

Is this what you want?

UPDATE mytable SET mycolumn 
  = REPLACE(mycolumn, '/home/user1','/home/user1/path/files');

Upvotes: 5

Related Questions