A.4.4 Existence Operator
In SQL, the existence test is applied to a sub-query. The condition tests if any result is returned by the sub-query. In a Style Studio query condition, a sub-query is treated the same as any named value. Therefore the existence test can be applied to any named value.
The result of the condition depends on the type of the data in the named value. If the value is a table, the existence test checks for the existence of any rows in the table. If the table is empty, the test returns false. Otherwise, it returns true.
If the value is a sequence (a node holding the collection of child nodes with the same type), the test checks for the existence of any child nodes in the sequence. If the sequence is empty, the test returns false. Otherwise, it returns true.
For all other values, the test is true if the value is not null.
exists query('salary over 200000')
The existence test can also be applied to a node. For example, to check if the “link” node exists:
exists link
| << A.4.3 SQL Pattern Matching Operator | © 1996-2013 InetSoft Technology Corporation (v11.4) | A.4.5 List Comparison >> |