记录个在工作中遇到的问题:
mysql> select substring_index(substring_index(‘batch_uname,0501201506240001′,’batch_uname,’,-1),’,',1);
+——————————————————————————————+
| substring_index(substring_index(‘batch_uname,0501201506240001′,’batch_uname,’,-1),’,',1) |
+——————————————————————————————+
| 0501201506240001 |
+——————————————————————————————+
1 row in set (0.01 sec)
mysql> select substring_index(‘batch_uname,0501201506240001′, ‘batch_uname,’, -1);
+———————————————————————+
| substring_index(‘batch_uname,0501201506240001′, ‘batch_uname,’, -1) |
+———————————————————————+
| 0501201506240001 |
+———————————————————————+
1 row in set (0.00 sec)
参考的文章:http://justdo2008.iteye.com/blog/1141609