shantanuo
shantanuo

Reputation: 32346

substring to return all values after delimiter

How do I get all the values after the first delimiter? In the following example I am expecting '[email protected],[email protected]'

(02:40) mysql>select substring_index('[email protected],[email protected],[email protected]', ',',  1) as first;
+-----------------+
| first           |
+-----------------+
| [email protected] |
+-----------------+
1 row in set (0.00 sec)

(02:41) mysql>select substring_index('[email protected],[email protected],[email protected]', ',',  -1) as last;
+-----------------+
| last            |
+-----------------+
| [email protected] |
+-----------------+
1 row in set (0.00 sec)

Upvotes: 3

Views: 3049

Answers (1)

Related Questions