Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Union Query

0 views
Skip to first unread message

JV

unread,
Jun 14, 2005, 10:19:04 AM6/14/05
to
What is a union query? When should it be used and when should it not be used?

Thanks in advance for the help.

Marshall Barton

unread,
Jun 14, 2005, 10:50:10 AM6/14/05
to
JV wrote:

>What is a union query? When should it be used and when should it not be used?

A UNION query tacks the data records of one query onto the
data records of another query. E.g.if you have two tables:

table1:
nm v
--------
A 1
B 2

table 2
txt num
------------
X 3
Y 4

then the union query:

SELECT nm, v FROM table1
UNION
SELECT txt, num FROM table2

will return the data records:

nm v
--------
A 1
B 2
X 3
Y 4

UNION queries are rarely needed in a propery normalized
database.

--
Marsh
MVP [MS Access]

0 new messages