IN expressions perform a membership test.
IN expressions address use cases where you want to identify a set of interest, and then filter to records with attributes that are in or out of that set. They are useful in conjunction with HAVING and PAGE expressions.
[Attr1, Attr2, …] IN StatementName
DEFINE HighValueCust AS SELECT SUM(SalesAmount) AS Value GROUP BY CustId HAVING Value>10000 ; RETURN Top_HVC_Products AS SELECT COUNT(1) AS NumSales WHERE [CustId] IN HighValueCust GROUP BY ProductName ORDER BY NumSales DESC PAGE(0,10)