Thanks to Hugh, Peter and Jose for the help, looks like a matter of having
all your ducks in a row :)



-----Original Message-----
Objects in one table = text objects some line objects
Objects in second table = region/polyg objects

Attempting to select objects in one table that are "Not Within" objects of a
second table.


[MYTEXT].Obj Within [MYINSETS].Obj
Naturally selects all the text objects that are found within the polygon
objects.



Is "Not Within" simply not doable?

Ex: [MYTEXT].Obj Not Within [MYINSETS].Obj


Aside from selecting all objects that "Are Within", then using the Inverse
select tool, just isn't pretty :)
----------------------------------------------------------------------------
-------------------------------
The correct syntax is

 ... Where Not ([MYTEXT].Obj Within [MYINSETS].Obj)

If you click the Verify button, it will say that the Syntax is correct,
however, when you click OK, you will get an error message like:

No join specified between tables [MYTEXT] and [MYINSETS]. Invalid join
condition in Where clause.

This is because you require a join of 2 tables for this type of query
and MapInfo SQL is very fussy about joins. The condition:

... Where ([MYTEXT].Obj Within [MYINSETS].Obj)

is OK, but if you use Not it is invalid. I'm sorry but I can't think of
a solution at the moment.

Hugh Grant
----------------------------------------------------------------------------
-------------------------------

Sure, it is doable. It's just a question of putting the words in the right
order ;-) 
And I also think that you need to use a subselect for this query: 

Select * From ONETABLE 
Where Not OBJ Within Any (Select Obj From SECONDTABLE) 

Note that I have placed the Not in front of the condition. This means that
MapInfo will start testing the condition, and if the condition is TRUE, it
will end up being FALSE; if the condition is FALSE it will end up being TRUE

But again, I will have to tell you that this query is slow (I'm actually not
sure whether this was what they fixed with the patch for MapInfo 8.0??), so
if speed is important, I would recommand you to leave out the NOT and use
the Invert selection afterwards

Peter Horsbøll Møller 
----------------------------------------------------------------------------
-------------------------------

The correct sintax is: 

NOT [MYTEXT].Obj Within [MYINSETS].Obj

(Note the not clause is before the object)

Hope this helps,

José Luis Armero Hernández

-- 
Outgoing mail is certified Virus Free
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.14/129 - Release Date: 10/11/2005
 


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

Reply via email to