How to select domain name from email address

后端 未结 13 2468
半阙折子戏
半阙折子戏 2020-12-08 02:05

I have email addresses like user1@gmail.com, user2@ymail.com user3@hotmail.com ... etc. I want a Mysql SELECT that will trim user name

相关标签:
13条回答
  • 2020-12-08 02:58

    Try this, removes the @ from the domain and just leaves the domain, example: domain.com

    select SUBSTR(SUBSTR(email_field, INSTR(email_field, '@'), INSTR(email_field, '.')), 2) as domain
    
    0 讨论(0)
提交回复
热议问题