日期:2014-05-16 浏览次数:20893 次
mysql> set @col='2|3|4'; Query OK, 0 rows affected (0.00 sec) mysql> select SUBSTRING_INDEX(@col,'|',1) as c1, -> SUBSTRING_INDEX(SUBSTRING_INDEX(@col,'|',2),'|',-1) as c2, -> SUBSTRING_INDEX(@col,'|',-1) as c3; +------+------+------+ | c1 | c2 | c3 | +------+------+------+ | 2 | 3 | 4 | +------+------+------+ 1 row in set (0.05 sec) mysql>