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 |
|
pradeep_iete
Yak Posting Veteran
84 Posts |
Posted - 2008-06-23 : 10:41:18
|
| I have table <contact>I wand to higllight the duplicate student .I am considering two parameter Name and Birthdate to identify such records even though the probablity of two different student having same name and same DOB is very less.Margin for bad result is relatively low for me.fisrtname middlename lastName birthdate------------------------------------------------peter jones clooney 29/06/2008peter jones clooney 29/06/2008both are actually same student but different from database point of view. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-06-23 : 10:59:48
|
| [code]SELECT t.fisrtname,t.middlename,t.lastName,t.birthdateFROM(SELECT ROW_NUMBER() OVER PARTITION BY (fisrtname,middlename,lastName ORDER BY birthdate) AS RowNo,*FROM YourTable)tWHERE t.RowNo=1[/code] |
 |
|
|
pradeep_iete
Yak Posting Veteran
84 Posts |
Posted - 2008-06-24 : 04:03:46
|
| It has worked really with slighty modification from my side.Thanx.Always expectin result from you. |
 |
|
|
|
|
|