Example:
SUBSTRING_INDEX() function
The MySQL SUBSTRING_INDEX function returns the substring of string before number of occurrences of delimiter.
Syntax:
SUBSTRING_INDEX(str, delim, count)
Example:
SUBSTRING_INDEX("www.Test.com", ".", -1)
---------------------------------------------------
com
Example2:
SELECT SUBSTRING_INDEX("www.Test.com", ".", -1);
Result:SUBSTRING_INDEX("www.Test.com", ".", -1)
---------------------------------------------------
com
Example2:
SELECT SUBSTRING_INDEX("www.Test.com", ".", 1);
Result:
SUBSTRING_INDEX("www.Test.com", ".", 1)
--------------------------------------------------
www
0 Comments