Chat now with support
Chat mit Support

Toad Data Studio 1.1 - Release Notes

Tutorial: Build a Subquery

Tutorial: Build a Subquery

In this tutorial you will create a subquery to use to filter your selection of address IDs to only those addresses from specific regions.

To build a subquery

  1. Connect to the Toad Sample (Access) database in the Navigation Manager.

  2. Select Tools | Query Builder | Query Builder.
  3. Drag the ADDRESS table to the Diagram pane.
  4. Click these column names in the ADDRESS table to add the columns to the query:

    • ADDRESS_ID
    • REGION_ID
  5. To add a subquery:
    1. Select the Where field in the REGION_ID column and click . The Where Condition editor displays.

    2. Select the IN operator from the list, and then click Subquery.

    3. A child Query Builder window displays for you to use to build the subquery.

      • The child (subquery) Query Builder window includes a Diagram pane, a Criteria pane, and a Queries pane for navigating back and forth between subqueries and the main query.

    4. Drag the REGION table to the Diagram pane and select the REGION_ID column.

    5. Select the Where field in the REGION_ID column and click . In the Where Condition editor, select the In comparison operator, select Constant, and select the values 1 and 2.

    6. Your subquery window should look something like this:

    7. Click to execute the subquery. Select the Results tab to review the result set for the subquery.
  6. Click the Query node in the Queries pane to return to the main query window. A call-out in the main query Diagram pane indicates that the statement contains a subquery and identifies the column it is on. Hover over the call-out to view the subquery statement.

  7. Click to execute the main query.

 

  

Related Topics  

Build Queries Visually

Add Subqueries

Verwandte Dokumente

The document was helpful.

Bewertung auswählen

I easily found the information I needed.

Bewertung auswählen