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 |
|
kishore7
Starting Member
13 Posts |
Posted - 2012-07-23 : 20:05:18
|
| Hi,I have two tables A and B , both tables are joined by UserIDIn table A i have a columns DOB, First-name and in table B i have column IP,now i need to count all the duplicate records. Also i need to list first-name of all those duplicate recordsI am Using sql server 2008*The criteria to find duplicate record is ,it should have same DOB and IPPlease help me out, i couldn't come up with a proper query for this.... |
|
|
singularity
Posting Yak Master
153 Posts |
Posted - 2012-07-23 : 20:16:25
|
| [code]select first_name, DOB, IPfrom(select first_name, DOB, IP, count(*) over (partition by DOB, IP) as cntfrom ajoin b on a.UserID = b.UserID) qwhere cnt > 1[/code] |
 |
|
|
|
|
|