Want to remove the last character in mysql as follows:
select substring(item, 1, length(item) - 1)
from table
But mysql returns the complete string containing the last char, the type of 'item' is mediumtext. The left
function seems to have the same problem.
The reason is that some characters are more than one byte. Use char_length solves the problem.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments