• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 11. Creating Multitable and Cros... > Writing UNION Queries and Subqueries

Writing UNION Queries and Subqueries

UNION queries and queries that include subqueries require you to write Jet SQL statements. Union is one of the three choices of Query Design view’s Query, SQL Specific menu. There is no menu choice for subquery. The following sections provide general syntax examples for writing UNION and subqueries, and provide simple Jet SQL examples. The general syntax examples use the same format as those of Chapter 21, “Moving from Jet Queries to Transact-SQL,” for T-SQL statements.

Using UNION Queries to Combine Multiple Result Sets

UNION queries let you combine the result set of two or more SELECT queries into a single result set. Northwind.mdb includes an example of a UNION query, which has the special symbol of two overlapping circles, in the Database window. You can create UNION queries only with SQL statements; if you add the UNION keyword to a query, the Query Design Mode button on the toolbar and the query design choices of the View menu are disabled.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint