Irwsoft Data Framework
|Topics||Using conditional syntax.|
|Syntaxes||Where, On and Having.|
There are many conditional syntax in sql like where, on and having. They are supported by Irwsoft Data Framework. The classes represents them are implements Irwsoft.Data.IComplexCondition, so how to use them are generally same.
This sample will show how to use where syntax in common select query.
- This sample apply to all where syntax of update query and delete query.
- This sample apply to having syntax of group-by syntax.
- This sample apply to on syntax of joins syntax.
select.Where.Compare( person.FirstName, ComparisonOperator.Equal, "Andy");
// you can even compare simple data 1 = 1
select.Where.Compare( 1, ComparisonOperator.Equal, 1);
// 2) Between condition : condition between min. Value and max. value
select.Where.Between(person.PersonId, 1, 10);
// 3) Like condition : condition with prefix of FirstName is Andy
// 4) In condition : PersonId equal to one of this values
select.Where.In(person.PersonId, 2, 4, 6, 8, 10, 15);
// Logical Operator : And
// Logical Operator : Or
// Open Curve Bracket
// Close Curve Bracket
Related Topics :