Useful mysql to remove / in a db column

Torbjorn Zetterlund ThunderBear
2
Here is a handy sql statement for removing a trailing '/' in the column url

[callout_box] UPDATE    websites
SET       url = LEFT(url, LENGTH(url) - 1)
WHERE     RIGHT(url, 1) = '/' [/callout_box] 

2 thoughts on “Useful mysql to remove / in a db column

  1. I am really impressed with your writing skills and also with the
    layout on your blog. Is this a paid theme or did you modify it yourself?
    Either way keep up the excellent quality writing, it’s rare to see a nice blog like this one these days.

Leave a Reply

Your email address will not be published. Required fields are marked *