WHERE
clauses. They can, for example, check if a value is equal to another value or if a value matches a specific pattern.x = y
) and "not equal" (x <> y
) are supported for all data types. See for example query below.x < y
), "greater than" (x > y
), "less than or equal" (x <= y
) and "greater than or equal" (x >= y
) are implemented for the data types String
, DateTime
and all numerical types. See example below.DateTime
value represents a timestamp it is often necessary to compare it with a DateTime
range. The query below returns all employees with a HireDate
between '2006-11-01 00:00:00.000'
and '2006-11-01 23:59:59.999'
.AND
, OR
, and NOT
:NOT
and OR
usually imply that indexes can't be used in the execution of the query, and therefore these operators should be used restrictively.x IS NULL
) and "is not null" (x IS NOT NULL
) are implemented for all data types. See for example query below.x LIKE y [ESCAPE z]
) is implemented for the data type String
. In the specified pattern (y
) the underscore character ('_'
) match any single character in the string, and the percent character ('%'
) match any sequence (possibly empty) of characters in the string. See for example query below.LIKE
predicate is an "escape character", for use when a percent or underscore character is required in the pattern without its special meaning. This is exemplified in query below.IS
checks if an object can be cast to a given type. It has similar semantics to Type.IsAssignableFrom
. Consider, for example, the following code:IS
operator can be used to determine inheritance in the data model. For instance, to retrieve all instances that can be cast to Teenager
, a query like this would be used:Child
and Teenager
instances "Johnny" and "Elsa" because they can both be cast as Teenager
.