Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Subqueries are select statements that are written within preexisting select statements and can be created in a few different ways:

  • Left-clicking the menu triangle in the [Select] Deck title and choosing [Create Subquery].
    Query Builder - Select Deck - Create Subquery MenuImage RemovedImage Added
  • Left clicking a Worksheet tab menu triangle and choosing [New > Subquery in Select]
  • Clicking the [Subquery] radio button when dropping off or choosing to edit an item in the Where or Having Decks.

Any of these create an additional [Subquery Worksheet] tab in the current Query Builder Workbook.

Query Builder - Subquery TabImage RemovedImage Added

The additional tab can be used to create via drag and drop of columns, views, and aliases your subquery just as you would create your Main query in the Query Builder.

Query Builder - Subquery - Diagram PaneImage RemovedImage Added

Subqueries can be executed on their own without having to execute the query that contains them. This makes modifying subqueries more convenient for testing.

Subqueries are identified by the Subquery Icon both in their tab and in the Worksheet Pane. If you return to the Main Query tab of your Query Builder Workbook (identified by the Main Query icon) you will see the Subquery displayed in the Select Deck and indicated with a green background color.

Query Builder - Subquery in Select DeckImage Modified

Info

If a Subquery is no longer used in the Select deck of the Main Query, that Subquery's worksheet name will become orange in the Worksheet Pane. Hovering over an orange Subquery Worksheet name in the Worksheet Pane will indicate why it is orange.

Query Builder - Subquery Not in Use - OrangeImage RemovedImage Added