Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Comparing two tables

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-05-16 : 10:19:49
Nicky writes "I am trying to comapre two tables. I have a 'core' table with a single column of core IDs and another table with programmes that have several IDs included within each one. How do I see which programmes the core Ids in the core table are a)included in and b) the only Ids for.
Please help"

YellowBug
Aged Yak Warrior

616 Posts

Posted - 2002-05-16 : 11:29:46
This may help:

SELECT programmes.*
FROM Core INNER JOIN programmes.CoreID

SELECT Core.ID
FROM Core WHERE Core.ID NOT IN (SELECT CoreID FROM programmes)

If you post your table definitions and sample data, we'd be able to give more specific code.
Go to Top of Page
   

- Advertisement -