Re: Easy way to exclude duplicate entries in recordset....

From: Frank Hickman [MVP] (fhickman_NOSP_at_M_noblesoft.com)
Date: 12/28/04


Date: Tue, 28 Dec 2004 02:18:21 -0500

It depends on what you want in your output and how it should be formatted.
If you just need to know all the different classes then you could do this
(assumes Access database):

SELECT DISTINCT [Class] FROM [MyTable];

If you wanted to know how many rows each class contained then you could do
this:

SELECT Count( [Shape] ), [Class] FROM [MyTable] GROUP BY [Class];

-- 
============
Frank Hickman
Microsoft MVP
NobleSoft, Inc.
============
Replace the _nosp@m_ with @ to reply.
"Matt S" <Matt S@discussions.microsoft.com> wrote in message 
news:8CE20F0E-8C20-42B9-BBF4-10A6E947F7F6@microsoft.com...
> Is there an easy way to exclude duplicate recordset entires using a filter 
> or
> some creative SQL trickery?  I am not all that familiar with SQL, but I 
> know
> enought simple stuff to gt by.
>
> I have data that looks like this..
>
> Shape    Class    Size
> W          W14    W14x22
> W          W14    W14x26
> W          W16    W16x26
> W          W16    W16x31
> W          W16    W16x36
> and so on
>
> I want to filter the Field column such that the resutltant recordset only
> contains one listing from each respective class I.E.
>
> W14
> W16
> W18 and so on.
>
> Is there an easy way to do this?
>
> ANy help is appreciated.