Substring function not working when truncated using mysql

zqiang0zh :

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.

zqiang0zh :

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.

edited at
0

Comments

0 comments
Login to comment

Related

TypeError when using substring function in Python 3

Why Is The Substring Function Not Working?

MySQL Insert using function not working

MySQL substring when LIMIT

Truncated image displayed when tried to retrieve from mysql database using python

Handle NULL when using substring function in where clause

String parsing failes when using a function doing substring in C

JSP Search Function Using Mysql not working

AND operator not working in a PHP function using MySQL

SQL error 1166 when using concat and substring/substring_index together in mysql

Suppress 'file truncated' messages when using tail

function is not working within pipeline when using mutate

Function not working the same way when using lapply

Polyglot seems not working when using translate function

casefold() function is not working when using Pandas Dataframe

Function not working when using it with Gooey module

MySQL user privileges not working when using IP

substring_index using in mysql

MySQL substring extraction using delimiter

Why are TRIM and SUBSTRING not working in this PL/pgSQL function?

MySQL Using index when joining a Function

Missing row when using mysql max function

Using substring to eliminate the directory path is not working

How to Avoid 'Data truncated for column' in Mysql Database Using java?

MYSQL Truncated incorrect DOUBLE while using double and single quotation marks

getting warning of 1292 Truncated incorrect DOUBLE value using IN operator in mysql

using mysql NOW() function to update row in database not working in PHP query

Influence of number of steps back when using truncated backpropagation through time

error_log message is truncated when using print_r