Link to home
Start Free TrialLog in
Avatar of lenamtl
lenamtlFlag for Canada

asked on

mysql query to adapt for a find and replace

Hi,

I need to adapt this Mysql query, this will be a manual query that I will run from PHPMyAdmin

update table_name set column_name = replace(column_name, ' ', '-'); 

Open in new window

I want to replace consecutive space by only one  -

example
report summer      2016.pdf
need to be change to report-summer-2016.pdf

actual result report-this------2016.pdf

Thanks
Avatar of Pawan Kumar
Pawan Kumar
Flag of India image

Pls trs this ..


--

update table_name set column_name = replace(column_name, '  ', '-'); 

--

Open in new window


--
Avatar of lenamtl

ASKER

Your solution is not working space remain and -- added
ASKER CERTIFIED SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@Author - Any update on this ?
Avatar of lenamtl

ASKER

Excellent
Thanks