Useful mysql to remove / in a db column

Torbjorn Zetterlund ThunderBear
0
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] 

 

Leave a Reply