Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 Site Related Forums
 Article Discussion
 Article: Deleting Duplicate Records
 Reply to Topic
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 3

Starting Member

4 Posts

Posted - 09/23/2011 :  10:11:17  Show Profile  Reply with Quote
This link provides different methods of delete duplicate rows in sql
Go to Top of Page

Starting Member

2 Posts

Posted - 11/30/2011 :  22:22:46  Show Profile  Reply with Quote
What if you just didn't want to count the duplicates, or report the duplicates? But you don't want to delete anything.

Ex. Service code xyz is in GL 12345 and also in GL 34567, all other information is the same (account number, etc) i don't want to count or report the duplicate if it's already being counted or reported by the first GL in the hierarchy. Ex. if it's in GL 12345 then I don't want to count/report on it if it's also in GL 34567.
Go to Top of Page

Starting Member

5 Posts

Posted - 01/16/2012 :  08:55:57  Show Profile  Visit petersJazz's Homepage  Reply with Quote
I found a way. In Oracle you would use the column value ROWID. In SQL Server you can use the column %%physloc%% to get a id for every row. If you want to remove one of the row in a table that has no unique index you can do something like this. Please test it out first before using it.
delete from table a
-- select a.*,%%physloc%% -- when testing it out
where 0 =
(select count(*)
from table b
where =
and b.%%physloc%% > a.%%physloc%%)

Go to Top of Page

Patron Saint of Lost Yaks

30421 Posts

Posted - 01/16/2012 :  16:57:26  Show Profile  Visit SwePeso's Homepage  Reply with Quote
No, you can't. There are a few rules that must be met before using %%physloc%%.

N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

Starting Member

3 Posts

Posted - 01/27/2012 :  14:08:35  Show Profile  Reply with Quote
Go to Top of Page

Starting Member

7 Posts

Posted - 06/06/2012 :  06:31:22  Show Profile  Reply with Quote

refer this link
Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Previous Page
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2019 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.07 seconds. Powered By: Snitz Forums 2000