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
Post a Comment