Re: to create a Query with 2 Tables

From: Gary Walter (garylwpleasenospam_at_wamego.net)
Date: 04/13/04


Date: Tue, 13 Apr 2004 10:47:01 -0500


"MDW" <anonymous@discussions.microsoft.com> wrote
> If you columns are in the same order for both tables:
>
> SELECT * FROM [Main Table]
>
> UNION
>
> SELECT * FROM [Purge Table]

PMFBI

If some record erroneously occurs in
both tables, you won't see that unless
you use

UNION ALL

(plus it is faster).

And I might want to know where
each record comes from

SELECT "Main" AS WhichTable, * FROM [Main Table]
UNION ALL
SELECT "Purge", * FROM [Purge Table]

Apologies again for butting in.

Gary Walter