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 |
JonJacobs
Starting Member
2 Posts |
Posted - 2010-03-15 : 08:50:13
|
I need a simple query that reveals duplicate values in a non-indexed column. I'm sure this one is quite simple, but it eludes me.Select MyColumn From MyTableWhere <more than one occurrance of a value>Thanks,Jon Jacobs |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-03-15 : 08:52:05
|
Select MyColumn,count(*) as DupCounter From MyTablegroup by MyColumn having count(*) > 1 No, you're never too old to Yak'n'Roll if you're too young to die. |
|
|
JonJacobs
Starting Member
2 Posts |
Posted - 2010-03-15 : 09:14:47
|
Thank you very much. I had forgotten all about the having clause. |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2010-03-15 : 09:20:35
|
You're welcome No, you're never too old to Yak'n'Roll if you're too young to die. |
|
|
|
|
|