Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > comparing two tables?

Reply
Thread Tools

comparing two tables?

 
 
Lord Merlin
Guest
Posts: n/a
 
      07-11-2004
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).


 
Reply With Quote
 
 
 
 
Bob Barrows [MVP]
Guest
Posts: n/a
 
      07-11-2004
Lord Merlin wrote:
> 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

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


 
Reply With Quote
 
 
 
 
Binoj Antony
Guest
Posts: n/a
 
      07-12-2004
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>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Comparing Two DataSets Will Lastname ASP .Net 20 03-29-2011 02:53 PM
How to compare two SOAP Envelope or two Document or two XML files GenxLogic Java 3 12-06-2006 08:41 PM
Comparing values between two arrays darrel ASP .Net 2 12-23-2005 05:11 PM
Comparing two arraylists =?Utf-8?B?RE9UTkVUR1VZ?= ASP .Net 1 08-24-2005 10:17 AM
Comparing two textboxes Steffen Loringer ASP .Net 1 04-26-2004 09:55 AM



Advertisments