SUBSTRING_INDEX('www.java2s.com', '.', -2); : SUBSTRING_INDEX « String Functions « MySQL Tutorial






mysql>
mysql> SELECT SUBSTRING_INDEX('www.java2s.com', '.', -2);
+--------------------------------------------+
| SUBSTRING_INDEX('www.java2s.com', '.', -2) |
+--------------------------------------------+
| java2s.com                                 |
+--------------------------------------------+
1 row in set (0.00 sec)

mysql>








23.43.SUBSTRING_INDEX
23.43.1.SUBSTRING_INDEX(str,delim,count): Returns the substring from string str before count occurrences of the delimiter delim
23.43.2.SUBSTRING_INDEX('www.java2s.com', '.', -2);