[ale] Selecting from multiple tables

Christopher Fowler cfowler at outpostsentinel.com
Sun Oct 2 21:05:30 EDT 2005


I have a need to do a mass select on multiple tables.  The problem is
that the tables are the same.  The do not contain the same data but have
the same schema and used for the same purpose.

We have this system in our application where we divide mulitple
Organiations into their own separate databases.  Each database has the
same schema  but the data is different.  I need the ability to see all
the alarms in the alarm table fro all organizations.  Normally I would
simply use 'use AC_DEMO; select * from alarm;'  In this case I need to
do something like 'select * from AC_DEMO.alarm, AC_WIP.alarm;'  The
reason I want to do it in the select and not in the application is
because we heavily use SQLs ability to sort and order the data.  So to
see all the alarms raised in order by date I would simply append 'order
by raised'.

This is not a simple join where you join tables by keys.  This is where
I want to select all the data from many tables that are the same.  Is
this possible?




More information about the Ale mailing list