Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Mondeo
Constraint Violating Yak Guru
287 Posts |
Posted - 2009-06-15 : 15:50:22
|
| Hi,I've got this dataa@yahoo.co.ukb@yahoo.co.ukc@yahoo.co.uka@hotmail.comb@hotmail.comI want to count the unique domain names, so for my results I wantyahoo.co.uk 3hotmail.com 2How can I do this?Thanks |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-06-15 : 15:52:16
|
SELECT SUBSTRING(Col1, CHARINDEX('@', Col1) + 1, LEN(Col1)) AS Domain, COUNT(*)FROM Table1GROUP BY SUBSTRING(Col1, CHARINDEX('@', Col1) + 1, LEN(Col1)) E 12°55'05.63"N 56°04'39.26" |
 |
|
|
|
|
|