Beginner's SQL: UNION Support
Many SQL tutorials will show you how to combine tables using joins before they discuss unions. This is a shame, because unions are easier. Children learning arithmetic are always taught first to add, and only then to multiply. Unions and joins are just like that. Unions combine tables by "adding" them, while joins combine tables by "multiplying" them.
In this article, the humble UNION operator is presented in all its simple glory. Its purpose, to combine tables, is illustrated with several useful examples.
Rudy Limeback
Rudy Limeback is an independent consultant with over 20 years of SQL experience using DB2, SQL Server, Access, Oracle, and MySQL. Rudy is also a Web developer, Technical Editor at Digital Web, one of the original evolt.org admins, with his own Web site since 1996. More information at r937.com. Rudy lives in Toronto, Canada, where the weather allows you to play frisbee golf all year long.