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 |
|
erni
Starting Member
2 Posts |
Posted - 2003-12-17 : 22:11:22
|
I've done as follows:SELECT col1, col2, col3, col4, COUNT(*) REPEATS FROM TABLE1GROUP BY col1, col2, col3, col4HAVING COUNT(*) > 1and got the results for repeated rows of those selected columns. Now, how do I go about deleting the entire row of these records from the table?   |
|
|
SamC
White Water Yakist
3467 Posts |
Posted - 2003-12-17 : 22:32:58
|
quote: how do I go about deleting the entire row of these records from the table?
There's no way to delete a partial row. Sounds like you need to delete "all" the rows when there are more than 1. But I think you want to delete the duplicates and leave 1 row?Read this article. |
 |
|
|
Amethystium
Aged Yak Warrior
701 Posts |
Posted - 2003-12-18 : 04:41:04
|
| [CODE]SELECT DISTINCT col1, col2, col3, col4 INTO TABLE1_NO_DUPSFROM TABLE1[/CODE]?________________Make love not war! |
 |
|
|
erni
Starting Member
2 Posts |
Posted - 2003-12-23 : 01:13:22
|
Thank you for directing to the article Amy, and also thanks Sam.Select DISTINCT is my prefered solution in my case. |
 |
|
|
|
|
|