insert query for unique records

A

Amod

Hello everyone
I am using SS2005. I am trying to create a query to insert unique records
from one table to another, but this uniqueness needs to be checked according
to my primary key field only & not by all the fields.

i am trying:
insert into OppTrack1 select distinct * from OppTrack2

but this checks for all the fields. please suggest how to do for just for
the PK field.
 
J

John Spencer

Well. A primary key by definition is unique. So you are going to get all
records in OppTrack2 returned. So using Distinct will have no effect on the
records that are to be appended to OppTrack1.

Am I misunderstanding your problem?


John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 

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