Akua,
The problem is that MapInfo can't join on these condition. MapInfo can
only join on a compare statement either with = or using one of the spatial
operators. I'm pretty sure that you can't negate these
statements.
So you can only find a solution using the sub select:
Select * From CT2000
Where not obj Partly Within
Any (Select obj From BranchesBuffer)
or you can choose a
different method where you join your two columns on two new temporary column,
could be Integer or Char(1) and add a condition to the join afterwards. You can
do that like this:
1. Add a new
Integer column to CT2000, let's call it ID_INT
2. Add a new
Integer column to BranchesBuffer, let's call it ID_INT
3. DO NOT update
this column with any value. It is suppose to hold the value 0 (zero) for all
records
4. Do this SQL
Statement:
Select * From CT2000, BranchesBuffer
Where
CT2000.ID_INT = BranchesBuffer.ID_INT
And
Not CT2000.obj Partly Within BranchesBuffer.obj
What is going on
here, you might ask ??!! I think Lars Nielsen explained this method earlier. The
first condition (CT2000.ID_INT =
BranchesBuffer.ID_INT) makes sure that every records in CT2000 is joined
with every record in BRANCHESBUFFER because every record in both table has the
same value in these columns, which is 0 (zero). This is known as the Cross Join
or Cartesian Product. The resultset will contain as many reocrds as the number
of records in table CT2000 times the number of records in table
BRANCHESBUFFER.
The second
condition adds a condition to the resultset telling MapInfo only to return the
records where not the object from CT2000 is partly within the object of
BRANCHESBUFFER.
It should work. One
thing that I can garanti you, is that it is going to take a while
;-)
Peter Horsbøll Møller
GIS Developer, MTM
Geographical
Information & IT
COWI A/S
Odensevej
95
DK-5260 Odense S.
Denmark
Tel +45 6311 4900
Direct +45 6311 4908
Mob +45 5156 1045
Fax +45 6311 4949
E-mail [EMAIL PROTECTED]
http://www.cowi.dk/gis
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Terry McDonnell
Sent: Monday, March 20, 2006 10:44 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [MI-L] Query for determining Entirely Within/Outside of Buffer
Akua
Perhaps you
could try:
Where not (CT2000.obj intersects BranchesBuffer.obj)
Iy might be useful if you include the FULL SQL select
you used as, given what you supplied, I can't immediately see any fault with it
that would cause the error.
Terry
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: 17 March 2006 22:01
To: Terry McDonnell
Subject: RE: [MI-L] Query for determining Entirely Within/Outside of Buffer
Thank you soooo much Peter and Terry!
I tried it out and have no problems with getting the tracts that
are entirely within or partly within, but when I get to querying objects "Not Partly Within" (Entirely Outside)
I keep getting the error message:
"No Join Specified between tables, Invalid Join Condition in Where Clause" and
I cannot figure out what the problem is.
The tables I have are called: CT2000 and BranchesBuffer
This is what I enter:
1) Where not CT2000.obj Partly Within Any BranchesBuffer.obj
and after this didn't work I tried
2) Not (CT2000.obj Partly Within BranchesBuffer.obj)
and I still got an error message. Any suggestions?
Thanks!
Akua
_______________________________________________ MapInfo-L mailing list [email protected] http://www.directionsmag.com/mailman/listinfo/mapinfo-l
