SSubqueries in From Clause

Subqueries in the FROM clause are represented as table controls on the diagram. They can be treated exactly as tables.

Creating Subqueries

To create a new subquery:

In the query document, do either of these actions to open the SubQuery tab:

  • Right-click the diagram and choose Create Subquery from the shortcut menu
  • Click the Create Subquery button on the Devart - Query toolbar
  • Select Create Subquery from the dbForge Query menu

The SubQuery tab appears where you can create the subquery - add a table, select required columns, specify conditions, etc.

You can include a table into a subquery in two clicks. Just right-click a table on the diagram, and select Wrap to Subquery item from the menu. The table shape will change its color and the subquery will be added to the query. You can add an alias to your subquery by typing it into the caption of subquery table shape. When the subquery is created, you can switch to the Text view to check the code.

To quickly navigate to your main query and subquery, use the tabs of the query document or open the Document Outline window.

To edit a subquery, click the action overflow button on the subquery title bar or right-click the subquery and select Edit Subquery from the shortcut menu.

To rename a subquery, double-click its title and enter a required alias.