David 

I think you could do it in > 2 SQL statements

1st you need to provide "dummy" fields for the ones that don't exist in
each, to get them into the same format.  E.g. TableA has a numeric field
(Field3) that TableB hasn't:

Select Field1, Field2, 0.00 "Field3", Field4 from TableB into csrTableB

TableB has a 3-char field, "Field2" that TableA hasn't

Select Field1, "   " "Field2", Field3, Field4 from TableA into csrTableA


Assuming the no duplicates of common fields exist between the 2 tables:

Insert into DestTable ( select * from csrTableA)
Insert into DestTable ( select * from csrTableB)

That should do it
HTH

Terry

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of David
Baker
Sent: 03 April 2006 14:45
To: Terry McDonnell
Subject: [MI-L] Joining tables with very different structures

I'm wondering if there is a tool hanging around that will do the
following: 
I don't see any problem writing one myself if not, but no sense re-
inventing the wheel.

I have 2 tables with some common columns, but 1 table has some extra
fields, and the other table has some different extra fields.

What I want to do is to combine the tables so I end up with 1 new table
which will have all the fields that exist in either of the 2 source
tables. 
The new table should also have all the records from both tables with
blanks (or zero) in the cells that didn't exist in the original tables.

I don't think I'd be the first one to ever have the need to do this.

Oh, and there is no spatial data in the tables - they are actually
mdb/tab combinations - I don't have Microsoft Access otherwise I'd
probably have better luck doing it there! :-) I've seen a couple of
tools around but they only appear to join tables with identical
structures.

Dave

_______________________________________________
MapInfo-L mailing list
[email protected]
http://www.directionsmag.com/mailman/listinfo/mapinfo-l

Reply via email to