jk11uk Posted April 24, 2010 Share Posted April 24, 2010 hi i have a table of different URLs, eg: http://www.site.com/pagesection/page.html and i'd like to find out how many distinct root domains there are. is this possible in MYSQL? So in the below list would equal 2 distinct root domains (i'd also like to be able to list them) www.site.com/page.html www.site2.com/page2.html www.site.com/section/adsf.php www.site.com thanks a lot guys! Link to comment https://forums.phpfreaks.com/topic/199598-regexp-msql-searchingsorting/ Share on other sites More sharing options...
jk11uk Posted April 25, 2010 Author Share Posted April 25, 2010 hi, any geniuses with ideas? Link to comment https://forums.phpfreaks.com/topic/199598-regexp-msql-searchingsorting/#findComment-1047885 Share on other sites More sharing options...
fenway Posted April 26, 2010 Share Posted April 26, 2010 Use SUBSTRING_INDEX with '/'. Link to comment https://forums.phpfreaks.com/topic/199598-regexp-msql-searchingsorting/#findComment-1048561 Share on other sites More sharing options...
jk11uk Posted April 26, 2010 Author Share Posted April 26, 2010 thanks so much for anyone else looking: http://icfun.blogspot.com/2008/07/mysql-substr-of-string-using.html Link to comment https://forums.phpfreaks.com/topic/199598-regexp-msql-searchingsorting/#findComment-1048566 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.