Class All
- Namespace
- YndigoBlue.Velocity.Functions
- Assembly
- YndigoBlue.Velocity.dll
Represents the ALL quantified comparison operator that tests if a condition is true for all values in a subquery.
public class All : Function, ICheckItem, IDefaultItem, IFilterItem, IElement
- Inheritance
-
All
- Implements
Remarks
The ALL operator is used with a comparison operator (=, <, >, etc.) to test if the condition is true for every value returned by a subquery. For example, "value > ALL (subquery)" returns true only if value is greater than every value in the subquery result. This is useful for ensuring a value exceeds all thresholds, finding maximum/minimum values with conditions, or universal quantification in queries.
Examples
Find products whose price is less than all competitor prices:
var schema = manager.LoadSchema("pricing");
var products = schema["products"];
var competitorPrices = schema["competitor_prices"];
var subQuery = new Query()
.Select([ competitorPrices["price"] ])
.From(competitorPrices);
var query = new Query()
.Select([ products["id"], products["name"], products["price"] ])
.From(products)
.Where(new Criterion<Expression>(products["price"], ConditionalType.LessThan, new Expression(new All(subQuery))));
var results = manager.Retrieve(query);
Constructors
- All(IEnumerable<IElement>)
Initializes a new instance of ALL for multiple elements.
- All(IElement)
Initializes a new instance of ALL for a single element.