Hi Markus,

You could do it via a subquery so the SQL would look something like this:

Select * From relation1 where NOT obj Within Any (Select obj From relation2)


However this SQL can get slow if you are dealing with large tables (I think
it does the subquery for every record in relation1).

A better method would be to do it in two steps. First create a temporary column
that sets a value if the obj is within the obj in the second table (you can
do this through the Update Column command under Table menu). And secondly do
a "not equals" selection on this newly created column.

The mapbasic syntax to do it looks something like this:

Add Column "relation1" ("Within" Logical)From relation2 Set To 1 Where contains
Dynamic

Select * from relation1 where Within<>"T" into Selection

Hope this helps.

Regards,
Sue.
++++++++++++++++++++++++++++++++++++++++
 adding   Susan Port
  value   Technical Support Coordinator
     to   [EMAIL PROTECTED]
   your
spatial   Spatial Plus
systems   http://www.spatialplus.com
++++++++++++++++++++++++++++++++++++++++

>Hi Listers,
>
>I am fighting with the following problem:
>I have two files and want to select all Objects from file#1 that do not lie
within objects >of file#2.
>Unfortunately, there is geographical operand "Within", but no operand "OutSide".

>What is the correct SQL-syntax for that problem?
>I tried "Select * From relation1, relation2 where NOT (relation1.obj Within
>relation2.obj)", but it didn't work.
>
>Thanks a lot for your help!
>Markus V.
----------------------------------------------------------------------
To unsubscribe from this list, send e-mail to [EMAIL PROTECTED] and put
"unsubscribe MAPINFO-L" in the message body, or contact [EMAIL PROTECTED]

Reply via email to