peeksey
peeksey

Reputation: 13

regex in mysql update statement, convert to lowercase

i'd like to update a table field in my mysql data base and convert all links to lowercase, e.g.

to convert:

http://www.domamain.com/MyLinks/News/FileName.html
to
http://www.domamain.com/mylinks/news/filename.html

Can this be done?

Thanks

Upvotes: 0

Views: 944

Answers (1)

Jason
Jason

Reputation: 10852

You can convert an entire column to lowercase with the LOWER() function

UPDATE mytable
SET url = LOWER(url)

It seems that you can't do regular expression replace in MYSQL though: How to do a regular expression replace in MySQL?

Upvotes: 1

Related Questions