|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I need to be able to count rows that have duplicate values in a particular column and then be able to eliminate all values belonging to the duplicate set from the result returned from a statement. Anyone have any idea how to do this?
|
|
#2
|
||||
|
||||
|
Try:
Code:
SELECT <list of all columns> FROM tablename GROUP BY <list of all columns> HAVING count(*) > 1
__________________
selwonk If I've posted some code above, you might think it looks a bit simplistic. It might be. I'd rather people tried the next step themselves rather than getting a full solution on a plate. That way they learn more! |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > Counting Duplicate Rows |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|