Thanks guys. Worked great.

Steve

-----Original Message-----
From: A. Razzak Memon [mailto:[EMAIL PROTECTED]
Sent: Monday, October 06, 2003 7:56 PM
To: [EMAIL PROTECTED]
Subject: [RBASE-L] - Re: Sub Select - Razzak's Reply



At 07:47 PM 10/6/2003 -0500, Steve Fogelson wrote:

>I am still moving data from foxpro. By the way thanks for all the help from
>the list to accomplish this. I have 2 tables stuctured like the following:
>
>Table1
>ID
>
>Table2
>ID
>FKID
>
>Presently there is not a foreign key relationship. I want to test Table 2
>before I put it in place. I think I need to use a subselect. Never had to
>use one.
>
>I want to check and find all instances where Table2.FKID is not present in
>Table1.ID
>
>Thanks for the help.


Steve,

Here's one way to cross check.

SELECT ID FROM Table2 WHERE ID NOT IN (SELECT ID FROM Table1)
Will display IDs in Table2 not related to Table1.

SELECT ID FROM Table1 WHERE ID NOT IN (SELECT ID FROM Table2)
Will display IDs in Table1 not related to Table2.

Hope that helps!

Very Best R:egards,

Razzak.

Reply via email to