Solved

remove duplicate rows based on criteria in SQL Server 2000

Posted on 2011-02-14
3
413 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
I have a large data set and a SSIS package. How can I load this file in multi threading?
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.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed

914 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

17 Experts available now in Live!

Get 1:1 Help Now