I have to get last 5 numbers using mysql.
My values are like YOT-A78514,LOP-C4521 ...
YOT-A78514
LOP-C4521
I have to get only last five char . How can I do this in query?
You can do this with RIGHT(str,len) function. Returns the rightmost len characters from the string str,
Like below:
SELECT RIGHT(columnname,5) as yourvalue FROM tablename
1.4m articles
1.4m replys
5 comments
57.0k users