LANSA and SQL Tip : Subselect parameter "ANY"
|Product/Release:||LANSA - All Platforms|
|Abstract:||The "ANY" subselect parameter can be used to execute a sub-selection from another file, before carrying out a requested selection|
|Submitted By:||LANSA Technical Support|
SOME and ANY work in the same way. They allow the execution of a sub-selection of another file before carrying out a requested selection.
For example, consider the customer and order files for the following values:
Select all customers with at least one order :
WHERE('CUSNUM = ANY(SELECT CUSNUM FROM ORDHEAD)')
The sub-selection defined here will select all customer numbers from file ORDHEAD. Then a condition will be set that the customer number selected from the file CUST matches at least one of the customer numbers from the previously created (sub-selection) table.
The result will be :