Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Eliminate duplicates, keep first instance

Posted on 2010-11-29
10
Medium Priority
?
273 Views
Last Modified: 2012-05-10
Please see attached description of problem in Word.
ee-query.doc
0
Comment
Question by:ejr19592004
  • 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 600 total points
ID: 34236993
try this
select min(date), id from table group by id
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

885 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