Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invert the selection? 1

Status
Not open for further replies.

gusbrunston

Programmer
Feb 27, 2001
1,234
US
[tt]
Hi:

I would like to get a list of PrimaryKeys in one table that are not included in another table. i.e., in the following, Table C is the result I want from a query:

Table A Table B Table C
3030 3030
3252 3252
3400 3400
3412 3412
3333 3333
3815 3815
3812 3812
3049 3049
3090 3090
3095 3095
3900 3900
3182 3182

Again, Table C
3252
3333
3095

(Then I hope to insert each row from Table C into Table B with all default values other than the key.)

Does this make sense?

Thanks in advance. I'm not as clear about things since the accident.[/tt]

[tt]
Gus Brunston - Access2000/2002(DAO)[/tt]
 
How about this..

SELECT tblA.A into tblC
FROM tblA LEFT JOIN tblB ON tblA.A = tblB.B
WHERE tblB.B Is Null;


 
[tt]
dc20, thank you so much!

Works just as advertised.[/tt]

[tt]
Gus Brunston - Access2000/2002(DAO)[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top