Skip to content

Instantly share code, notes, and snippets.

@MajidSafari
Created April 20, 2017 07:14
Show Gist options
  • Save MajidSafari/9082f76bce08c72a3b3888c09beb2e0d to your computer and use it in GitHub Desktop.
Save MajidSafari/9082f76bce08c72a3b3888c09beb2e0d to your computer and use it in GitHub Desktop.
Mail Check Domain
SELECT RIGHT(Email, LEN(Email) - CHARINDEX('@', email)) Domain ,
COUNT(Email) EmailCount
FROM Article.tblNewsLetter
WHERE LEN(Email) > 0 AND MailCheck=1 AND IsActive=1
GROUP BY RIGHT(Email, LEN(Email) - CHARINDEX('@', email))
ORDER BY EmailCount DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment