[MySQL]: How to split a string into multiple columns in a SQL statement
mysql> select * from test; +——+———————+ | id | name | +——+———————+ | 1 | /root/path/to/leaf | | 1 | /var/lib/mysql/data | +——+———————+ 2 rows in set (0.00 sec) mysql> mysql> select id,name, SUBSTRING_INDEX(name, ‘/’, 2) as first_val, SUBSTRING_INDEX(name,…