On Sat, Jan 17, 2009 at 5:48 AM, Cheng Zhang <[email protected]> wrote: > Problem: query below returns one row which is wrong. > > select * from oag:CustomerReviews where AverageRating > 5 > > but query below is ok: > > select * from oag:CustomerReviews where AverageRating > 5.0 > > A bug?
AFAIK a double value (such as AverageRating) must be compared against a double literal in sql/xpath queries, ie. include a dot like "5.0". The JCR spec does not mandate long<->double conversion in that case: "In case of type mismatches in a comparison LONGs can be converted to DOUBLEs". [1] http://www.day.com/specs/jcr/1.0/8.5.4.3_WHERE.html Regards, Alex -- Alexander Klimetschek [email protected]
