works like a charm... thank you so much Charles
just a quick small thing on it.. when i run the query, the last character of the field is cutoff
for eg: it shows like '@hotmail.co'
something we can do to quick fix that?
really appreciate it.
Get yourself a good SQL reference. I'm using O'Reilly's SQL Pocket Guide. Or dig around the internet and find a list of the SQL Server functions. http://msdn.microsoft.com/en-us/library/ms187748.aspx You'll note that the third parameter passed to substring specifies the length of the substring returned. Try instead
substring ("Email", charindex ('@', "Email"), length ("Email")) as "Domain, count (*) as "Num"
group by substring ("Email", charindex ('@', "Email"), length ("Email"))
“The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
—Tim Berners-Lee, W3C Director and inventor of the World Wide Web