1. Computing & Technology

Discuss in my forum

Mike Chapple

UNION Queries in SQL

By , About.com GuideApril 15, 2010

Follow me on:

SQL's UNION command allows you to combine the results of two or more database queries that are not necessarily linked through a database relationship. For example, imagine that you have a school database and wish to use it to create a master contact list for all students, faculty and staff. Looking at your database, you discover that the records corresponding to each of these constituencies appears in separate database tables.

Your first instinct might be to export the data from each table into a spreadsheet and combine the information there. However, you can combine these records within your database by writing separate queries for each constituency and combining the results of those queries with the UNION statement.

Read the full article: Combining Query Results with SQL's UNION Statement
Comments
No comments yet.  Leave a Comment
Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>
Related Searches union queries

©2012 About.com. All rights reserved.

A part of The New York Times Company.