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 |
|
KidSQL
Yak Posting Veteran
88 Posts |
Posted - 2005-04-28 : 09:09:03
|
| Hello,I have a table with several million rows and I've just found out that it contains duplicates, which is a headache as I need to get rid of them to set primary keys, etc.I'd like to investigate these, however, so I was wondering if there was an easy way of returning these in QA. My table looks like this:Date IDFor which there should be one unique date + ID combination. Does anyone know how would I structure a query to return all rows where the count(date+ID)>1?My apologies for asking what should be an easy query. |
|
|
TG
Master Smack Fu Yak Hacker
6065 Posts |
Posted - 2005-04-28 : 09:13:20
|
| Hey KidSQL! Seems like only yesterday we talked...select [Date], [ID] from myTable Group by [Date], [ID] having count(*) > 1Be One with the OptimizerTG |
 |
|
|
KidSQL
Yak Posting Veteran
88 Posts |
Posted - 2005-04-28 : 09:30:03
|
| That's right, we did!Jeez, this is embarrasing. I'm almost positive I've used this query before.Thanks again, TG. Your help (and patience) is much appreciated. |
 |
|
|
|
|
|