Working with sub-queries
This topic describes working with Sub-queries used in criteria expressions to limit the result dataset (usually in the WHERE and HAVING clauses). To find out how to work with sub-queries used as datasources for the main query (i.e. in the FROM and WITH clauses) refer to the Working with Derived Tables topic.
You may add a sub-query as part of the expression or condition in the Columns Pane while editing text in a cell. To add a sub-query, right-click at the text position for a new sub-query and select the Insert Sub-query item from context popup menu or type the "(Select)" text to the Expression column, the "= (Select)" or "In (Select)" text to the Criteria column. Please note that curly brackets are necessary.
To build a newly added sub-query visually, confirm editing by pressing the Enter key. The corresponding tab is created above the Query Building Area and the ellipsis button becomes visible at the right side of the cell (*). By clicking on the ellipsis button you'll be switched to a sub-query tab where you can build it visually in Building a single query as the main query. If the cell contains more than one sub-query, the drop-down list will appear to select the required sub-query.
The ellipsis button appears only in the VCL and ActiveX Editions of Visual Query Builder.
You can always get back to the main query and switch to any sub-query or derived table using the tabs above the Query Building Area or using the Navigating the Query Tree .
© Copyright 2017-2023 ActiveDBSoft. All rights reserved.