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 |
gagani
Posting Yak Master
112 Posts |
Posted - 2014-11-03 : 06:05:59
|
select pr.birthdate, pr.operationdate from patientrecord prTotal no.of rows = 24420select distinct pr.birthdate, pr.operationdate from patientrecord prTotal no.of rows = 23528It seems there are some rows with same birthdate and operationdate.I want to get the list of rows(with all columns) that has got same birthdate and operationdate |
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2014-11-03 : 08:43:44
|
[code];with cte as( select *, row_number() over (partition by birthdate,operationdate order by operationdate) as RN from YourTable) select * from cte where RN > 1;[/code] |
|
|
|
|
|