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:
a property called height with value less than 100 and
a property called keyword with substring “apple”.
The evaluation order within an expression is:
<, >, =, <=, >=, <>, LIKE, IS NULL, IS NOT NULL (Operators)
NOT (Logical negation)
AND (Logical conjunction)
OR (Logical disjunction)
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 220.127.116.11 Property Constraint and 18.104.22.168 Searching Multi-value Properties.