select a query into a table

ponneri

Registered User.
Local time
Today, 10:49
Joined
Jul 8, 2008
Messages
102
Hi all.

I have a query that appends 5 tables with 2 columns of same name. The query runs fine.

But how do I move it into a new table with the select into option ?

I get an error that it does not work with an action query ?

Please help.

my query :

select order_id, part_num from a,
union all
select order_id, part_num from b,
union all
....... so on
till table e
 
Since the union queries are SQL only view, I tend to make a wrapper query to to this. Create a new query using QBE. Select the union query and all columns. Change the query type to Make Table and provide the name of the new table. Save, Run.

However, I would be remiss if I didn't caution you that copying data into temp tables is rarely necessary. Usually simply using a select query inside another query solves your problem. Temp tables (or permanent tables where you delete/add rows over and over again) cause bloat and so should be avoided unless absolutely necessary. If you use these methods, be sure to compact your database on close to clean up the debris.
 
Thanks Pat.

I'll try that and see.
 

Users who are viewing this thread

Back
Top Bottom