comparing two tables?

L

Lord Merlin

How do I compare the contents of two tables, to see what doesn't exist in
the one table?

Something like "select company.name, company_scores.company_name from
company, company_scores where company.name not in
company_scores.company_name" ?

--


Kind Regards
Rudi Ahlers
+27 (82) 926 1689

Greater love has no one than this, that he lay down his life for his friends
(John 15:13).
 
B

Bob Barrows [MVP]

Lord said:
How do I compare the contents of two tables, to see what doesn't
exist in the one table?

Something like "select company.name, company_scores.company_name from
company, company_scores where company.name not in
company_scores.company_name" ?

Please don't multipost. I've already replied to this question over at
..asp.db. If you feel you must direct your question at multiple
newsgroups*, then post one single message to the desired groups by
putting the group names into the To list (aka crosspost)

*.asp.db is the only group you needed to post this to. Your question
concerns asp and database code: absolutely no ambiguity.

Bob
 
B

Binoj Antony

Try This

<CODE>

SELECT company.name, company_scores.company_name
FROM company
LEFT JOIN company_scores ON (company_scores.company_name = company.name)
WHERE company_scores.company_name IS NULL

OR

SELECT company.name, company_scores.company_name
FROM company
LEFT JOIN company_scores ON (company_scores.company_name = company.name)
WHERE company.name IS NULL

</CODE>
 

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

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,240
Members
46,830
Latest member
HeleneMull

Latest Threads

Top