Select all but the first character in a string

mysql, substring

Solution

Use `SUBSTR` (or `SUBSTRING`):

SELECT SUBSTR( 'hello', 2 );
--> 'ello'

See also: MySQL String Functions

Problem

How can you return a string minus the first character in a string in MySQL? In other words, get 'ello' from 'hello'. The only way I can think to do it is to use mid() with the second offset being larger than the string could possibly be: ``` select mid('hello', 2, 99) ``` But I'm convinced there must be a more elegant way of doing it. Is there?

Original source