Learn more about Toad for SQL Server
at Quest.com

Find solutions and downloads at the
Toad for SQL Server Support Portal

< To bookmark a page, right-click the Page Title and select Add to Favorites / Bookmark This Page

Toad for SQL Server 5.7

You are here: Build Queries Visually > Define Criteria > Add Subqueries

Add Subqueries

You can add one or more subqueries to further limit the tables and records returned from a SELECT statement when setting a WHERE, OR, or HAVING condition in the Query Builder.

For additional help with subqueries, see the Tutorial: Build a Subquery.

To add a subquery

  1. Select the Where, the Having, or the Or field in the column and click .

  2. Click Subquery in the Condition editor.  A new child Query Builder displays for you to use to build the subquery.

  3. Drag tables or views to the subquery Diagram pane to build the subquery.

  4. Define subquery criteria.

  5. 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.

Tips:

 

Related Topics

Build Queries Visually