mysql - Discard last 3 characters of a field -


i want extract first (not last three) characters of string table like:

code -------- cref182 cxef7u8 cef7u8 cf777 

how can perform query discard last 3 characters of string in result shows like:

code -------- cref cxef cef cf 

i'm thinking should opposite of mysql right function? suggestions?

how about:

select reverse(substr(reverse(code), 4)) code yourtable; 

Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -