![]() Type the table name Union1, and click OK. Choose Paste a second time to create
a table named Union2. Open Union1, and delete the last seven rows from the
table. (Just highlight the rows and hit the Delete key.) Open Union2, and delete
the first seven rows of the table. Thus, Union1 will consist of the first half of the
BOOKS, table and Union2 will consist of the second half of BOOKS.
2.
The simplest way to take the union is to use the same Copy...Paste procedure that
we used in Step 1. To illustrate, highlight Union2, and choose Copy from the Edit
menu. Then choose Paste, and enter the table name Union1. Select the Append
Data to Existing Table option. If you then click OK, the rows of the copied table
(Union2) will be appended to the rows of the table Union1. In other words,
Union1 will now contain the union of the original Union1 table and the Union2
table, which in this case is the complete contents of BOOKS. This is expressed in
symbols as:
NewUnion1 = OriginalUnion1
Union2
Open Union1 to verify that it now has 14 rows. Then delete the last seven rows
again to restore Union1 to its original condition.
Another way to create a union is to use an Append Query as follows:
1.
From the Query tab in the Database window, choose the New button. Select
Design View, and then add Union2 to the design window. Select Append from the
Query menu to get the dialog box in Figure 5-3.
Figure 5-3. The Access Append dialog box
2.
Click OK to get the window shown in Figure 5-4. Drag the asterisk (*) in the table
scheme for Union2 to the first cell in the Field row of the design grid. This will
fill in the first column of the design grid as shown in Figure 5-4. Run the query
(choose Run from the Query menu). You will get a warning that you are about to
append seven rows and that the process cannot be undone. Click OK, and then
open the Union1 table to verify that it now has 14 rows.
|
|