Re: Joining tables



Try a UNION query, i.e.:
SELECT a.* FROM a
UNION ALL
SELECT b.* FROM b;

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"David" <david.goodyear@xxxxxxxxx> wrote in message
news:1146037764.958508.314620@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi, if i use two queries in brackets

(SELECT * FROM a)
(SELECT * FROM b)

where both tables have the same columns, but a has different data in a
column, can i merge them using SQL through a odbc driver to an access
datafile?

I.e.

In table a

Row 1
Field1 = David
Field2 = Florida
Field3 = ''

Row 2
Field1 = David
Field2 = NY
Field3 = ''

In table b

Row 1
Field1 = David
Field2 = Florida
Field3 = 01234 567 890

So as a result I would get a table with

Row 1
Field1 = David
Field2 = Florida
Field3 = 01234 567 890

Row 2
Field1 = David
Field2 = NY
Field3 = ''

If I did have to do this in 2 seperate querys, can I join these
together in msaccess sql through odbc. Im having trouble getting JOIN
or INTERSECT to work at the moment, do these work using SQL acess to a
access datafile?

Thanks in advance

David


.



Relevant Pages