Solved

Eliminate duplicates, keep first instance

Posted on 2010-11-29
10
271 Views
Last Modified: 2012-05-10
Please see attached description of problem in Word.
ee-query.doc
0
Comment
Question by:ejr19592004
[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
  • 6
  • 3
10 Comments
 
LVL 19

Expert Comment

by:Bhavesh Shah
ID: 34236589
Hi,

There are no rows with green color also I'm not able to find any duplicate rows.
PLease update ur list
0
 

Author Comment

by:ejr19592004
ID: 34236954
My apologies. Late in the day, just leaving work. I have modified the word document and added a spreadsheet with sample data. Please advise if you have any questions.

Ta

ee-query.doc
Sample-Data.xls
0
 
LVL 5

Assisted Solution

by:Priya Perumpilavil
Priya Perumpilavil earned 150 total points
ID: 34236993
try this
select min(date), id from table group by id
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

Author Comment

by:ejr19592004
ID: 34237724
This looks right, except I need to include the acct field (field B in the spreadsheet) in the output as well as in:

select acct, min(date) from table group by acct


If by ID you mean the account number than we are good.
0
 
LVL 19

Expert Comment

by:Bhavesh Shah
ID: 34237737
Hi,

Priya meant that only......
0
 

Author Comment

by:ejr19592004
ID: 34241284
@Birchsoft Priya meant that only? Only what?
0
 

Author Comment

by:ejr19592004
ID: 34241534
Just so that we are clear. When I run a remove duplicate code on the file by acct code, that is column B in the spreadsheet, I end up with 1136 records.

If I run the statement select acct, min(date) from table group by acct, which I will later on today, I need to end up with 1136 records.

0
 
LVL 19

Expert Comment

by:Bhavesh Shah
ID: 34241700
Hi,

your problem is resolved?? or you have confusion sort of....
0
 

Accepted Solution

by:
ejr19592004 earned 0 total points
ID: 34242269
@Brichsoft it's resolved if

select acct, min(date) from table group by acct

means select acct (column b in the spreadsheet), min(date) - column a in the spreadsheet from table group by acct

Yields 1136 records from the dataset and only the first instance of each duplicate.

I will know in about an hour or so when I get into work
0
 

Author Closing Comment

by:ejr19592004
ID: 34276789
Fits the bill. Ta
0

Featured Post

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

Data architecture is an important aspect in Software as a Service (SaaS) delivery model. This article is a study on the database of a single-tenant application that could be extended to support multiple tenants. The application is web-based develope…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

636 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