Solved

Eliminate duplicates, keep first instance

Posted on 2010-11-29
10
262 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
Comment Utility
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
Comment Utility
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
Comment Utility
try this
select min(date), id from table group by id
0
 

Author Comment

by:ejr19592004
Comment Utility
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
Comment Utility
Hi,

Priya meant that only......
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:ejr19592004
Comment Utility
@Birchsoft Priya meant that only? Only what?
0
 

Author Comment

by:ejr19592004
Comment Utility
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
Comment Utility
Hi,

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

Accepted Solution

by:
ejr19592004 earned 0 total points
Comment Utility
@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
Comment Utility
Fits the bill. Ta
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

743 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

12 Experts available now in Live!

Get 1:1 Help Now