Mapinfo 9 - Join 3 tables together SQL?

1,467 views
Skip to first unread message

hawker180

unread,
Mar 25, 2010, 2:33:43 AM3/25/10
to MapInfo-L
Hello All,

Im having some issues trying to join 3 tables together in Mapinfo.

Table1) "Property_Selection_RT"
Table2) "Property_MP"
Table3) "Assessment"

the unique fields to join are:

first join:
Table:"Property_Selection_RT" (Field: Prop_PFI) and joining to
Table:"Prop PFI" on (Field: Property_MP)

second join:
Table:"Property_MP" (Field: Prop_Pronum) and joining to
Table:Assessment - (Field: Ass_Num)

Hope that makes sence

As im not a regular mapinfo user can someone please help me with the
SQL command?

thanks

Thomas Bacon

unread,
Mar 25, 2010, 4:40:56 AM3/25/10
to mapi...@googlegroups.com
I think you may have to do the first join, save the results off as a
table, then use the newly saved table to join with your third table.
You can not carry out a join on anything that is not a base table.

HTH,

Tom

Hello All,

Hope that makes sence

thanks

--
You received this message because you are subscribed to the Google
Groups "MapInfo-L" group.
To post to this group, send email to mapi...@googlegroups.com.
To unsubscribe from this group, send email to
mapinfo-l+...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/mapinfo-l?hl=en.

The information in this e-mail is confidential and may be legally privileged. It is intended solely for the addressee. Access to this email by anyone else is unauthorised. Any views or opinions expressed in this e-mail may be solely those of the author and are not necessarily those of Mouchel. Mouchel Limited, Registered in England at Export House, Cawsey Way, Woking, Surrey, UK, GU21 6QX Registered No : 1686040

Greg Driver

unread,
Mar 25, 2010, 4:57:21 AM3/25/10
to MapInfo-L
On Mar 25, 6:33 am, hawker180 <hawker...@gmail.com> wrote:
> Hello All,
>
> Im having some issues trying to join 3 tables together in Mapinfo.
>
> Table1) "Property_Selection_RT"
> Table2) "Property_MP"
> Table3) "Assessment"
>
> the unique fields to join are:
>
> first join:
> Table:"Property_Selection_RT" (Field: Prop_PFI) and joining to
> Table:"Prop PFI" on (Field: Property_MP)
>
> second join:
> Table:"Property_MP" (Field: Prop_Pronum) and joining to
> Table:Assessment - (Field: Ass_Num)
>

Hi,

I think something along these lines should work from the Query -> SQL
Select dialog

Select Columns: *
From Tables: Property_Selection_RT, Property_MP, Assessment
Where condition: Property_Selection_RT.Prop_PFI = Prop PFI.Property_MP
and Prop PFI.Property_MP = Assessment.Ass_Num
into Table Named: Selection

There's a knowledge base article which might help as well:

http://tinyurl.com/yjv3qlm

HTH

Greg.

Peter Horsbøll Møller

unread,
Mar 25, 2010, 5:01:41 AM3/25/10
to mapi...@googlegroups.com
You can try this join thru the MapBasic window:

Select *
From
Property_Selection_RT, Property_MP, Assessment
Where Property_Selection_RT.Prop_PFI = Property_MP.Prop_PFI
And Property_MP.Prop_Pronum = Assessment.Ass_Num

I hope that I got the table and field names right.

If you want to use the SQL Select dialog enter these values into these fields in the dialog:


From Tables: Property_Selection_RT, Property_MP, Assessment
Where: Property_Selection_RT.Prop_PFI = Property_MP.Prop_PFI And Property_MP.Prop_Pronum = Assessment.Ass_Num


Peter Horsbøll Møller
Pitney Bowes Business Insight - MapInfo


2010/3/25 hawker180 <hawk...@gmail.com>

hawker180

unread,
Mar 25, 2010, 3:04:43 AM3/25/10
to MapInfo-L
I forgot to say the before, the Ass_num is a Intager

I have also been able to join the following together:


Table:"Property_Selection_RT" (Field: Prop_PFI) and joining to
Table:"Prop PFI" on (Field: Property_MP)

which worked out fine, its hust that the "Field:Prop_Pronum" is a text
field and "Field:Ass_Num" is an intager

thanks

hawker180

unread,
Mar 25, 2010, 6:42:37 AM3/25/10
to MapInfo-L
Thanks everyone for your help! Much appreciated! Peter i ended up
using your second option and it worked like a charm!

thanks again

- Luke


On Mar 25, 8:01 pm, Peter Horsbøll Møller <mapinf...@horsboll-


moller.dk> wrote:
> You can try this join thru the MapBasic window:
>
> Select *
> From Property_Selection_RT, Property_MP, Assessment
> Where Property_Selection_RT.Prop_PFI = Property_MP.Prop_PFI
> And Property_MP.Prop_Pronum = Assessment.Ass_Num
>
> I hope that I got the table and field names right.
>
> If you want to use the SQL Select dialog enter these values into these
> fields in the dialog:
>

> *From Tables*: *Property_Selection_RT, Property_MP, Assessment**
> * *Where*: *Property_Selection_RT.Prop_PFI = Property_MP.Prop_PFI** And
> Property_MP.Prop_Pronum = Assessment.Ass_Num
> *


>
> Peter Horsbøll Møller
> Pitney Bowes Business Insight - MapInfo
>

> 2010/3/25 hawker180 <hawker...@gmail.com>


>
> > Hello All,
>
> > Im having some issues trying to join 3 tables together in Mapinfo.
>
> > Table1) "Property_Selection_RT"
> > Table2) "Property_MP"
> > Table3) "Assessment"
>
> > the unique fields to join are:
>
> > first join:
> > Table:"Property_Selection_RT" (Field: Prop_PFI) and joining to
> > Table:"Prop PFI" on (Field: Property_MP)
>
> > second join:
> > Table:"Property_MP" (Field: Prop_Pronum) and joining to
> > Table:Assessment - (Field: Ass_Num)
>
> > Hope that makes sence
>
> > As im not a regular mapinfo user can someone please help me with the
> > SQL command?
>
> > thanks
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "MapInfo-L" group.
> > To post to this group, send email to mapi...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > mapinfo-l+...@googlegroups.com<mapinfo-l%2Bunsu...@googlegroups.com>

Thomas Bacon

unread,
Mar 25, 2010, 7:20:49 AM3/25/10
to mapi...@googlegroups.com

Try this:

Select * From Property_Selection_RT, Property_MP, Assessment Where Property_Selection_RT.Prop_PFI = Prop PFI.Property_MP and Prop PFI.Property_MP = Str$(Assessment.Ass_Num) into Selection

HTH,

Tom



-----Original Message-----
From: mapi...@googlegroups.com [mailto:mapi...@googlegroups.com] On Behalf Of hawker180

--
You received this message because you are subscribed to the Google Groups "MapInfo-L" group.
To post to this group, send email to mapi...@googlegroups.com.

To unsubscribe from this group, send email to mapinfo-l+...@googlegroups.com.


For more options, visit this group at http://groups.google.com/group/mapinfo-l?hl=en.

Reply all
Reply to author
Forward
0 new messages