Mike,

Assuming you have a common value in the two tables (i.e. primary key ->
foreign key relationship) then try the following:-

        Select * From TableA Where ID_A Not In(select ID_B from TableB)

ID_A and ID_B are the fields holding the common values in the respective
tables.

Should do the trick.

Or if the relationship is a geographical one:-

        Select * From TableA Where Obj Not Intersects Any (Select Obj From
TableB)

This could be used with point, polyline and polygon types. If TableA were
polygons only you could use the Within operator instead of Intersects. Also,
depending on your data or requirements it may be more appropriate to swap
the tables around if using Within. In theory the geographical query above
should work although I have a suspicion you can't use 'Not' with the
geographical operators as I've done. In which case, remove the 'Not', run
the query, then invert the selection.

Regards,

Keith

-----Original Message-----
From: Michael Smith [mailto:[EMAIL PROTECTED] 
Sent: 10 March 2004 22:24
To: 'Mapinfo-L'
Subject: MI-L object not in table


Hi,

Can someone tell me how if I have two tables using a query, how do I find
out which records from table A are not in Table B?  Thanks in advance!

Mike


---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com | To
unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 10771


This email and any attached files are confidential and copyright protected.
If you are not the addressee, any dissemination of this communication is
strictly prohibited. Unless otherwise expressly agreed in writing, nothing
stated in this communication shall be legally binding.



---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 10783

Reply via email to