Solved

remove duplicate rows based on criteria in SQL Server 2000

Posted on 2011-02-14
3
412 Views
Last Modified: 2012-05-11
Hi, I have some data in SQL where I need to remove duplicates based on certain criteria.  A sample of the data is follows:-

Property      Item      Date      Location
100      G7FIRE      10/10/2010      LOUNGE
100      G6BBU      11/10/2010      LOUNGE
100      G7FIRE      12/10/2010      KITCHEN
101      G6BBU      13/10/2010      LOUNGE
102      G7FIRE      14/10/2010      KITCHEN
105      G7FIRE      10/10/2010      LOUNGE
105      G6BBU      11/10/2010      LOUNGE
105      G7FIRE      12/10/2010      KITCHEN


For properties 100 and 105 there is a G6BBU and a G7FIRE in the SAME location of LOUNGE.  If this is the case then I need to find and remove the G7FIRE.

So for properties where the is a G6BBU and a G7FIRE in the SAME LOCATION (which could be lounge, kitchen, anywhere) I need to remove the G7FIRE line?

Is there an update query that I can run to apply this?

Many thanks,
Deborah
0
Comment
Question by:howsonhome
  • 2
3 Comments
 
LVL 39

Accepted Solution

by:
Pratima Pharande earned 500 total points
ID: 34886840
0
 
LVL 39

Expert Comment

by:Pratima Pharande
ID: 34886849
0
 

Author Closing Comment

by:howsonhome
ID: 34886979
Thanks!!
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now