Database Reference
In-Depth Information
Figure 6.36
Use EXISTS to create intersection.
Figure 6.37
Use NOT EXISTS to create difference.
Figure 6.38
Copy data from one table to another with subquery.
Another useful application of a subquery is to populate a table by copying data from another
table. he example in Figure 6.38 shows how the table NEW_BUILDING is populated with the
data stored in the table BUILDING.
Note that, for the subquery used in the INSERT statement, you do not need to enclose it within
parentheses. As mentioned before, the JOIN keyword can also be used in a query involving multiple
tables. In the following section, we are going to query information from tables that are joined together.
Search WWH ::




Custom Search