Show TOC Start of Content Area

Syntax documentation Comparison predicate  Locate the document in its SAP Library structure

The comparison predicate is used to compare two values. The left hand side operand has to be a value expression whereas the right hand sight operand can additionally be a dynamic parameter specification or a scalar sub-query.

Syntax

Syntax

<comparison predicate> ::=  
         <value expression>
                 <comparison operator>
                      ( <value expression>
                     
| <dynamic parameter specification>
                      | <scalar subquery> ).

<comparison operator> ::= '<' | '=' | '>' | '<=' | '<>' | '>='.

 

The data types of the two <value expression>s in the <comparison predicate> must be comparable.

If either of the <value expression>s is NULL, the result of the <comparison predicate> is unknown.

Note

It is not possible to test for NULL values with a comparison predicate. You may wish to use a null predicate instead.

More information about comparable types: Open SQL Data Types

Examples

Example

SELECT * FROM a WHERE c > 0

Comparison predicate.This SELECT yields all rows from table a where the column a.c has a value larger than 0.

Example

DELETE FROM employees WHERE employee_id = ?

Dynamic Parameter in Comparison Predicate. All employees with the employee_id equal to a given parameter are delete from the table employees.

End of Content Area