Thanks,
Cory Martin
As no SQL experts seem to be chirping in I'll take a look at your
problem. Could you outline what's needed and I'll see if I can come up
with a soln.
Terry McDonnell
MIPro cannot perform a left join, nor a right join, only inner joins are
supported..
However, since a left join is in effect the left table (when no join
occurred, i.e. with a null right table) + an inner join (when a join
occurred), it ought to be possible to emulate the result of a left join.
Best regards / Med venlig hilsen
Lars I. Nielsen
GisPro
So, you want all rows from L table, and some fields from R table,
presumably with those fields from R table empty where no match, but
filled where there's a match. I'm not sure how experienced you are with
MB either, and maybe you're as experienced as I am at doing this anyway.
-----Original Message-----
From: mapi...@googlegroups.com [mailto:mapi...@googlegroups.com] On
Behalf Of Cory Martin
Sent: 25 April 2007 15:01
To: Terry McDonnell
Subject: [MI-L] Re: Left Join
In a left join query, I would get back all of the rows of the first
table even if it didn't find its match in the other table(s). I don't
want to have to simulate a left join by adding new columns to the
original table and then updating these fields with values from the other
table(s) where the keys match. Unfortunately, MapInfo Professional
appears unable to perform any type of query other than a standard inner
join. I'm guessing it doesn't even support unions.
Or use a full scale backend sql server (MS/SQL, Oracle, Postgres or even
MySQL), at let it do the heavy sql work. This is how many applications
work these days.
Besides, I think MIPro SQL actually predates ANSI SQL 1992, not that it
matters much.
Best regards / Med venlig hilsen
Lars I. Nielsen
GisPro
Using Geoserver or MapServer to serve PostGIS results to MapInfo via
WMS is a cool idea! And I too would love to see MapInfo connect to
PostGIS.
My only comment is that the free Oracle XE includes "Locator", a
castrated version of Spatial.
Rich
--
Richard Greenwood
richard....@gmail.com
www.greenwoodmap.com
MapInfo supports some kind of Left join, it's call Add Column:
Add Column table ( column [ datatype ] )
{ Values const [ , const ... ] |
From source_table
Set To expression
[ Where { dest_column = source_column |
Within | Contains | Intersects } ]
[ Dynamic ] }
This will let you update an existing column or add a new temporary column to your table.
I know it isn't what you call a left join but it does the trick.
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 p...@cowi.dk
http://www.cowi.dk/gis
-----Original Message-----
From: mapi...@googlegroups.com [mailto:mapi...@googlegroups.com] On Behalf Of Lars I. Nielsen (GisPro)
Sent: Wednesday, April 25, 2007 4:21 PM
To: mapi...@googlegroups.com
Subject: [MI-L] Re: Left Join