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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Display duplicate record in a table

Author  Topic 

Delinda
Constraint Violating Yak Guru

315 Posts

Posted - 2008-09-02 : 20:51:06
Hi,

I need help to display duplicate rows (more than 1 record) in my table. Let's say my table as

tblCurrUser
UsrID | UsrModule
--------------------
189 | Kmi
144 | Kmi
189 | Kmi
187 | Kmi
121 | Kmi
134 | Kmi
188 | Kmi
187 | Kmi
188 | Kmi
187 | Kmi
...
...

How to built SQL to display duplicate record? The expected result as follow,

189
189
187
187
187
188
188
...
...

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-09-02 : 20:53:02
[code]
select UsrID
from tblCurrUser
group by UsrID
having count(*) > 1
[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

Delinda
Constraint Violating Yak Guru

315 Posts

Posted - 2008-09-03 : 01:05:39
tq very much.
Go to Top of Page
   

- Advertisement -