// EqualResult := TBISQL.From(Data, 'Name where Customer = 123');// Not equalResult := TBISQL.From(Data, 'Name where Status <> "Inactive"');// Greater than / Less thanResult := TBISQL.From(Data, 'Name where Price > 100');Result := TBISQL.From(Data, 'Name where Quantity < 10');// Greater or equal / Less or equalResult := TBISQL.From(Data, 'Name where Price >= 100');Result := TBISQL.From(Data, 'Name where Quantity <= 10');
Result := TBISQL.From(Data, 'ProductName where (Price > 50) and (Category = "Electronics")');Result := TBISQL.From(Data, 'sum(Amount) where (Customer=123) and (Product<456) group by Country');
// Static listResult := TBISQL.From(Data, 'ProductName where Category in ["Electronics", "Books", "Toys"]');// Sub-queryResult := TBISQL.From(Data, 'ProductName where CategoryID in select ID from Categories where Active=true');
// Compare to aggregateResult := TBISQL.From(Data, 'ProductName, UnitPrice where UnitPrice > select Average(UnitPrice)');// Using IN with sub-queryResult := TBISQL.From(Data, 'OrderID where CustomerID in select ID from Customers where Country="USA"');
Sub-queries are evaluated first and their results used in the outer query filter.
Filters create an index array for efficient access:
var Cursor: TDataCursor;begin Cursor.Filter := MyFilterExpression; Cursor.PrepareIndex; // Build index // Access filtered rows efficiently for I := 0 to Cursor.Count - 1 do Position := Cursor.Index[I];end;