[SQL User Wannabe] Extracting Distinct Records Based on Two Fields

D

Don

I am trying to develop a query which will report records with a unique pair
of fields. Probably better explained using a simple example:

LastName FirstName
Dog Big
Cat Fat
Mouse Sqweeky
Dog Alpha
Dog Big

Running the query would result in:

Dog Big
Cat Fat
Mouse Sqweeky
Dog Alpha

There are other fields in the record that need to be ignored.

Any suggestions?

Thanks!

Don
 
J

John Gilson

Don said:
I am trying to develop a query which will report records with a unique pair
of fields. Probably better explained using a simple example:

LastName FirstName
Dog Big
Cat Fat
Mouse Sqweeky
Dog Alpha
Dog Big

Running the query would result in:

Dog Big
Cat Fat
Mouse Sqweeky
Dog Alpha

There are other fields in the record that need to be ignored.

Any suggestions?

Thanks!

Don

SELECT DISTINCT LastName, FirstName
FROM T

Regards,
jag
 
D

Don

John Gilson said:
SELECT DISTINCT LastName, FirstName
FROM T

Regards,
jag

John,

Thanks!

Is there any way to include the remaining fields from the record? Would the
"SELECT DISTINCT" become a sub-query of a primary query that includes all
the fields from the record?

Thanks again!

Don
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top