23.10.2012 Views

Openedge Data Management: SQL Reference - Product ...

Openedge Data Management: SQL Reference - Product ...

Openedge Data Management: SQL Reference - Product ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Relational operators<br />

208<br />

Table 49: Relational operators and resulting predicates<br />

Relational<br />

operator Predicate for this relational operator<br />

= True if the two expressions are equal.<br />

| != | ^=<br />

Basic Predicate<br />

A basic predicate compares two values using a relational operator. If a basic predicate specifies<br />

a query expression, then the query expression must return a single value. Basic predicates often<br />

specify an inner join.<br />

If the value of any expression is null or the query_expression does not return any value, then the<br />

result of the predicate is set to false. This is the syntax for a basic predicate:<br />

Quantified Predicate<br />

True if the two expressions are not equal. The operators != and ^= are<br />

equivalent to .<br />

< True if the first expression is less than the second expression.<br />

True if the first expression is greater than the second expression.<br />

>= True if the first expression is greater than or equal to the second<br />

expression.<br />

Syntax<br />

expression relop { expression | ( query_expression ) }<br />

The quantified predicate compares a value with a collection of values using a relational<br />

operator. A quantified predicate has the same form as a basic predicate with the<br />

query_expression being preceded by the ALL, ANY, or SOME keyword. The result table returned<br />

by query_expression can contain only a single column.<br />

When you specify ALL, the predicate evaluates to true if the query_expression returns no values<br />

or the specified relationship is true for all the values returned.<br />

When you specify SOME or ANY, the predicate evaluates to true if the specified relationship is true<br />

for at least one value returned by the query_expression. There is no difference between the SOME<br />

and ANY keywords. The predicate evaluates to false if the query_expression returns no values or<br />

if the specified relationship is false for all the values returned. This is the syntax for a quantified<br />

predicate:<br />

Syntax<br />

expression relop { ALL | ANY | SOME } ( query_expression )

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!