Ansicht
Dokumentation

ABENWHERE_LOGEXP_ALL_ANY_SOME - WHERE LOGEXP ALL ANY SOME

ABENWHERE_LOGEXP_ALL_ANY_SOME - WHERE LOGEXP ALL ANY SOME

RFUMSV00 - Advance Return for Tax on Sales/Purchases   BAL Application Log Documentation  
This documentation is copyright by SAP AG.
SAP E-Book

Short Reference

- ALL, ANY, SOME

... operand operator $[ALL$|ANY$|SOME$] ( SELECT subquery_clauses $[UNION$|INTERSECT$|EXCEPT ...$] ) ...

Effect

Comparison of an operand operand with the result set of a subquery. The clauses in the subquery subquery_clauses must represent a scalar subquery. The language elements UNION, INTERSECT, and EXCEPT can be used to combine the result sets of multiple subqueries. In this case, special rules query_clauses apply to specifying clauses.

Any SQL expressions except aggregate expressions and window expressions can be specified for operand. In a HAVING clause, aggregate expressions can also be used.

operator stands for a comparison operator. Result sets can be single row or multirow.

Note

When an SQL expression occurs on the left side, the syntax check is performed in a strict mode, which handles the statement more strictly than the regular syntax check.

Single Row Result Set

If the result set of the subquery defined by the clause subquery_clauses contains only one row, the comparison can be performed without specifying ALL, ANY, or SOME. The expression is true if the corresponding comparison of the value of the operand operand with the result of the scalar subquery returns "true". If the result set for the subquery contains multiple rows, an uncatchable exception is raised when the statement is executed.

Example

Reading of the flights with the most passengers.

Multirow Result Set

If the result set of the subquery defined by the clause subquery_clauses contains more than one row, ALL, ANY, or SOME must be specified.

  • If using ALL, the expression is true if the comparison is true for all rows in the result set of the scalar subquery.
  • If the addition ANY or SOME is used, the expression is true if it is true for at least one of the rows in the result set of the subquery.

Note

The equality operator (= or EQ) in conjunction with ANY or SOME acts like IN subquery.

Example

Reading of the customer number of the customer or customers who have made the most bookings:






ABAP Short Reference   General Material Data  
This documentation is copyright by SAP AG.

Length: 4043 Date: 20240424 Time: 032439     sap01-206 ( 54 ms )