Solved

Eliminate duplicates, keep first instance

Posted on 2010-11-29
10
263 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 150 total points
ID: 34236993
try this
select min(date), id from table group by id
0
 

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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

This article will describe one method to parse a delimited string into a table of data.   Why would I do that you ask?  Let's say that you need to pass multiple parameters into a stored procedure to search for.  For our sake, we'll say that we wa…
Recently, when I was asked to create a new SQL 2005 cluster, Microsoft released a new service pack for MS SQL 2005 what is Service Pack 3. When I finished the installation of MS SQL 2005 I found myself troubled why the installation of SP3 failed …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

867 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

16 Experts available now in Live!

Get 1:1 Help Now