mysql split string between two characters


We have already seen, How to split string in MySQL query in my previous post. Now I like to expand this with more worth thinks by doing. Lets consider task to split the string between two characters in mysql.

How to get split the tld from url

below example will describe how to extract tld in mysql from website URL or domain.

Example :

Result: .in
Task: getting the tld from url.

Sample Data table

website name website Url
Wild into the society

Mysql Query

 tld from website

Little More

okay we got it now, I think lets go little further. we may to exclude the few domain when we find the countries. here we see how to do that. I am going to exclude the blog spot websites when I from extract query

 tld from website where  LOCATE('.blogspot.',website_url) = 0

Have fun!




Posted in MySql and tagged by .

About Gowri

I am professional web developer with 8+ years experience. PHP, jQuery, WordPress, Angular and Ionic are my key skills in web development. I am working with strong enthusiastic team with spirit. We provide all web related solution like HTML/CSS development, Web graphic design and Logo.