8.5.4.3 WHERE

The WHERE clause allows you to place constraints on the nodes (rows) returned by specifying values or ranges of values for the properties (columns) of those nodes (rows). For example, the query,

SELECT myapp:image FROM mynt:document WHERE height < 100 AND keyword LIKE '%apple%'

would find all the properties called myapp:image of nodes of type mynt:document (and subtypes) that also have:

The evaluation order within an expression is:

Literal values of types NAME, PATH and STRING must be enclosed in single quotes. Any literal single quote within the pattern must be escaped as two consecutive single quotes.

The collation sequence used when comparing STRING values using >, <, >= or <= is implementation-specific.

For types LONG and DOUBLE comparisons are done by numeric value, not string representation.

In case of type mismatches in a comparison LONGs can be converted to DOUBLEs; for any other type mismatch each operand is converted to STRING (see 6.2.6 Property Type Conversion) and compared using the established collation sequence.

See also 6.6.3.3 Property Constraint and 6.6.4.10 Searching Multi-value Properties.