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 |
itmasterw
Yak Posting Veteran
90 Posts |
Posted - 2013-03-27 : 09:36:54
|
Hi,Both of these check for duplicate rows but what is the difference between them?select distinct source_file, claimNo, memberid, count(*)from dbo.Claims_Header_2013group by source_file, claimNo, memberidhaving count(*)>1select distinct source_filefrom dbo.Claims_Header_2013group by source_file, claimNo, memberidhaving count(*)>1thank youITM |
|
bandi
Master Smack Fu Yak Hacker
2242 Posts |
Posted - 2013-03-27 : 09:42:17
|
This is the main logic..... ( logic for checking duplicate combination of source_file, claimNo, memberid)group by source_file, claimNo, memberidhaving count(*)>1If you need the source_file, claimNo, memberid, count(*) cnt in the display, then consider first query; Otherwise use second query |
|
|
itmasterw
Yak Posting Veteran
90 Posts |
Posted - 2013-03-27 : 10:25:17
|
Thank you that made it clearerITM |
|
|
|
|
|
|
|