Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

remove duplicate rows based on criteria in SQL Server 2000

Posted on 2011-02-14
3
Medium Priority
?
418 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 39

Accepted Solution

by:
Pratima Pharande earned 2000 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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

704 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