UNION ALL question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

All,

I need to combine/unite like 50 queries into one table. I am using an SQL
'UNION ALL' way to do it. I am in the middle of it. Thought there must be
some easier ways. Please advice.

Thanks,
Alish
 
UNION won't be able to handle that many SELECTs.
Instead, execute 50 append queries to add the data to a temporary table.

Hopefully this is just for importing data from 50 different sources. If you
actually have 50 tables with the same structure in the one database, that's
a wrong design.
 
I have 50 queries with different criterias that groups employees into
different sub-groups. I am trying to have one roster out of all 50. If there
is an easier way, please advice on that. Thanks.
 
The main roster (1) that the 50 queries read off is updated every week. But
it does not have the information that breaks downd into different subgroups.
I have another table that I use in the queries to make the subgroups (main
roster 2). The second main roster that contains all the 50 queris is
consequently updated accorsding to the 1 main roster. That is the way I want
to have it. The only problem here is how to combine all the 50 queries into
one main table.
 
We can't see your structure, of course, but the solution is probably to use
an IN operator to select the members of the groups you want.

Say one query chooses the members of group "A", and the next the member of
group "B", and so on. You choose them all with criteria:
IN ("A", "B", "C", ...
 
Back
Top