Mysql Parsename Equivalent

Mysql Parsename Equivalent is SUBSTRING_INDEX() function

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:
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

Post a Comment

0 Comments