I need to update values in a table by removing their last char if they ends with a +
Example:
John+Doe
and John+Doe+
should both become John+Doe
.
What's the best way to achieve this?
UPDATE table
SET field = SUBSTRING(field, 1, CHAR_LENGTH(field) - 1)
WHERE field LIKE '%+'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With