Solved

remove duplicate rows based on criteria in SQL Server 2000

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sql 2014,  lock limit 5 32
SSRS 2013 - Creating a summarized report 19 35
Sql server function help 15 31
Alternative of IN Clause in SQL Server 3 21
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
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…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

777 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