Append only new records

B

bhammer

This must be simple, but . . .

INSERT INTO tblComponents.Component
SELECT Component
FROM tblComponentsDefault
WHERE tblComponentsDefault.Component <> tblComponents.Component;

I get an enter parameter dialog.

I simply have a default list of components in one, unrelated table
that the user can choose to append to the "real" components table (the
one with relationships to other tables), if they choose to. The user
may have no entries, or many entries in tblComponents, so I simply
want to add from the default list and avoid duplicates. The ID does
not come into play here, so . . . ?
 
K

KARL DEWEY

Try this --
INSERT INTO tblComponents.Component
SELECT Component
FROM tblComponentsDefault LEFT JOIN tblComponents ON
tblComponentsDefault.Component = tblComponents.Component
WHERE tblComponents.Component IS NULL;
 

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