Connecting Tech Pros Worldwide Help | Site Map

filtering duplicate fields with unique rows

google@digiinsider.com
Guest
 
Posts: n/a
#1: Sep 5 '06
I have a query that outputs the following,

A | Name1 | Date1
A | Name2 | Date2
B | Name1 | Date1
B | Name2 | Date2

I would like to see,

A | Name1 | Date1
B | Name1 | Date1

In some cases, there could be more than 2 duplicates for the first
column field.

I would just like the first row of each duplicate field found in column
1.

Please advise as to the SQL Syntax I may be able to use to complete
this.

Thanks in advance.

Randy Harris
Guest
 
Posts: n/a
#2: Sep 5 '06

re: filtering duplicate fields with unique rows


On 5 Sep 2006 08:39:45 -0700, google@digiinsider.com wrote:
Quote:
>I have a query that outputs the following,
>
>A | Name1 | Date1
>A | Name2 | Date2
>B | Name1 | Date1
>B | Name2 | Date2
>
>I would like to see,
>
>A | Name1 | Date1
>B | Name1 | Date1
>
>In some cases, there could be more than 2 duplicates for the first
>column field.
>
>I would just like the first row of each duplicate field found in column
>1.
>
>Please advise as to the SQL Syntax I may be able to use to complete
>this.
>
>Thanks in advance.
What you need is an aggregate query.

Select
Category,
First(NameField) AS NameField,
Max(DateField) AS DateField
From
MyTable
Group By
Category

HTH,
Randy
pGwtech
Guest
 
Posts: n/a
#3: Sep 5 '06

re: filtering duplicate fields with unique rows


Thanks Randy. Found this on Microsoft's site,

http://office.microsoft.com/en-us/as...581033.aspx#13

Similar to what you are talking about.

Closed Thread