select distinct

M

Matt Pollicove

Sorry to post a basic question, but it's been some time since I have done
any DB type programming.

I have a table in Access 2003 with basic information fname, lname, street,
city, state, zip.

I want to create a query to return only the rows that have unique lname and
streeet.

I can get the query to return only the unique elements, but I need all the
fields in the query.

Thanks much!

Matt
 
G

Gerald Stanley

If the table had a primarykey column, then the query would be

SELECT T1.* FROM {yourTable} T1
WHERE T1.{primaryKeyColumn} IN (SELECT TOP 1
{primaryKeyColumn} FROM {yourTable} T2 WHERE T1.fname =
T2.fname AND T1.lname = T2.lname)

Hope This Helps
Gerald Stanley MCSD
 

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