Thursday, October 16, 2014

MySql, find email address




Find email address end of @sfu.ca (table mail, column email_add)
trim(mail.email_addr)  like '%@sfu.ca'
Without containing . in id part:
trim(mail.email_addr)  not like '%\.%@sfu.ca'
Extract id part of email address, ie. the string before @sfu.ca
LEFT(mail.EMAIL_ADDR, LOCATE('@', mail.EMAIL_ADDR) - 1)

No comments:

Post a Comment