I have queries based upon unions of many tables. Here is an example of the sql:
TABLE [tblWG113A1514-2] UNION ALL TABLE [tblWG113A1714-2] UNION ALL TABLE [tblWG113N1147-3] UNION ALL TABLE [tblWG113N1222-3] UNION ALL TABLE [tblWG113N1303-3] UNION ALL TABLE [tblWG113N1323-3] UNION ALL TABLE [tblWG113N3102-1] UNION ALL TABLE [tblWG113N3152-1] UNION ALL TABLE [tblWG113U1000-5] UNION ALL TABLE [tblWG113U1000-6] UNION ALL TABLE [tblWG113U1000-7] UNION ALL TABLE [tblWG113U1000-8] UNION ALL TABLE [tblWG115A1120-1] UNION ALL TABLE [tblWG115U8201-32] UNION ALL TABLE [tblWG115U8201-33] UNION ALL TABLE [tblWG115W1120-5] UNION ALL TABLE [tblWG65B13174-1] UNION ALL TABLE [tblWG65B13472-2] UNION ALL TABLE [tblWG65B13472-3] UNION ALL TABLE [tblWG65B13473-1] UNION ALL TABLE [tblWG65B13473-3] UNION ALL TABLE [tblWG65B17057-1] UNION ALL SELECT *
from [tblWG113A1312-2];
From this, another query is run which compiles several more unions.....
for example:
SELECT * FROM [TW Union]
UNION ALL
SELECT * FROM [VSM Union]
UNION ALL
SELECT * FROM [WG Union]
UNION ALL SELECT * FROM [WM Union];
UNION ALL SELECT * FROM [FT UNION];
TABLE [tblWG113A1514-2] UNION ALL TABLE [tblWG113A1714-2] UNION ALL TABLE [tblWG113N1147-3] UNION ALL TABLE [tblWG113N1222-3] UNION ALL TABLE [tblWG113N1303-3] UNION ALL TABLE [tblWG113N1323-3] UNION ALL TABLE [tblWG113N3102-1] UNION ALL TABLE [tblWG113N3152-1] UNION ALL TABLE [tblWG113U1000-5] UNION ALL TABLE [tblWG113U1000-6] UNION ALL TABLE [tblWG113U1000-7] UNION ALL TABLE [tblWG113U1000-8] UNION ALL TABLE [tblWG115A1120-1] UNION ALL TABLE [tblWG115U8201-32] UNION ALL TABLE [tblWG115U8201-33] UNION ALL TABLE [tblWG115W1120-5] UNION ALL TABLE [tblWG65B13174-1] UNION ALL TABLE [tblWG65B13472-2] UNION ALL TABLE [tblWG65B13472-3] UNION ALL TABLE [tblWG65B13473-1] UNION ALL TABLE [tblWG65B13473-3] UNION ALL TABLE [tblWG65B17057-1] UNION ALL SELECT *
from [tblWG113A1312-2];
From this, another query is run which compiles several more unions.....
for example:
SELECT * FROM [TW Union]
UNION ALL
SELECT * FROM [VSM Union]
UNION ALL
SELECT * FROM [WG Union]
UNION ALL SELECT * FROM [WM Union];
UNION ALL SELECT * FROM [FT UNION];