User`s guide

16.6.1 What is a subquery?
A subquery is a more flexible kind of query filter that allows you to restrict values in more sophisticated
ways than with an ordinary query filter.
Subqueries are more powerful than ordinary query filters for the following reasons:
They allow you to compare the values of the object whose values are used to restrict the query with
values from other objects.
They allow you to restrict the values returned by the subquery with a WHERE clause.
Subqueries allow you to pose complex questions that are difficult or impossible to formulate with simple
query filters. For example: what is the list of customers and their associated revenue where the customer
purchased a service that had previously been reserved (by any customer) in Q1 of 2003?
16.6.2 Building a subquery
You build a subquery in the Query Filters pane of the Query Panel.
Note:
You can mix subqueries and other types of query filter in the Query Filters pane.
16.6.2.1 To build a subquery
1.
Add the objects that you want to appear in the query to the Result Objects pane.
2.
Select the object that you want to filter with a subquery, and then click Add a subquery.
The subquery outline appears in the Query Filters pane. By default the object you selected appears
as the Filter object and Filter By object. For more information on the Filter Object and Filter By object,
see Subquery parameters.
3.
To add a WHERE condition to the subquery, drag a query object to the white area of the subquery
outline.
Note:
You can use an existing subquery or standard query filter as a WHERE condition in a subquery. To
do so, drag and drop the existing filter or subquery to the white area of the subquery outline.
4.
Select the operator and values used to filter the object in the WHERE condition.
2012-03-14355
Building Queries