How we can find domain name using MySQL and regular expression

前端 未结 5 1869
花落未央
花落未央 2020-12-07 02:08

i am having some list of domains in the DB,like

http://www.masn.com/index.html
http://www.123musiq.com/index.html etc

w

5条回答
  •  盖世英雄少女心
    2020-12-07 02:53

    use substring_index

    http://dev.mysql.com/doc/refman/5.1/en/string-functions.html#function_substring-index

    like

    SELECT  SUBSTRING_INDEX(urlfield, '/', 1) from mytable
    

提交回复
热议问题