[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
- <!--x-content-type: text/plain -->
- <!--x-date: Mon, 03 Oct 2005 10:03:51 -0400 -->
- <!--x-from-r13: zzvyyfba ng zrevgbayvarflfgrzf.pbz ([vxr [vyyfba) -->
- <!--x-message-id: [email protected] -->
- <!--x-reference: [email protected] --> "http://www.w3.org/TR/html4/loose.dtd">
- <!--x-subject: [ale] Selecting from multiple tables -->
- <li><em>date</em>: Mon, 03 Oct 2005 10:03:51 -0400</li>
- <li><em>from</em>: mmillson at meritonlinesystems.com (Mike Millson)</li>
- <li><em>in-reply-to</em>: <<a href="msg00008.html">[email protected]</a>></li>
- <li><em>references</em>: <<a href="msg00008.html">[email protected]</a>></li>
- <li><em>subject</em>: [ale] Selecting from multiple tables</li>
e.g.
select column from (select * from table1 union select * from table2
union select * from table3).
Mike
On Sun, 2005-10-02 at 21:05, Christopher Fowler wrote:
> 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?
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> <a rel="nofollow" href="http://www.ale.org/mailman/listinfo/ale">http://www.ale.org/mailman/listinfo/ale</a>
</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<!--X-Follow-Ups-End-->
<!--X-References-->
<ul><li><strong>References</strong>:
<ul>
<li><strong><a name="00008" href="msg00008.html">[ale] Selecting from multiple tables</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Christopher Fowler)</li></ul></li>
</ul></li></ul>
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00013.html">[ale] Selecting from multiple tables</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00015.html">[ale] Selecting from multiple tables</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00025.html">[ale] Selecting from multiple tables</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00016.html">[ale] [OT]Seeking Hard Drive</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00014"><strong>Date</strong></a></li>
<li><a href="threads.html#00014"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>
<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>