PS - When you get done cleaning up the data, look up "Foreign Key Constraints",
and if at all possible add one to your child table, so your system will never
allow this situation to occur again.
[quoted text, click to view] On Thu, 07 Dec 2006 22:48:38 -0700, Lee Boozer <leeboozer@cox.net> wrote:
>Select *
> From B
> Where Not Exists (Select * From A Where A.keyval = B.keyval)
>
>
>On Wed, 6 Dec 2006 11:47:37 -0000, "G .Net" <nodamnspam@email.com> wrote:
>
>>Hi
>>
>>Can anybody tell me the sql query I need to find the following:
>>
>>I have two tables A and B. A is a parent to B.
>>
>>I need to find the rows in B which do not have a corresponding foreign key
>>value to a row in A.
>>
>>Thanks in advance
>>
>>G