Hi, I don't know how you got the strange results for PostgreSQL. I can't reproduce it. For all queries below, I get one row, meaning the comparison yields "true" for PostgreSQL 8.4.4, H2, HSQLDB, Derby, and MySQL. I used the H2 Console tool:
drop table test; create table test(id int); insert into test values(1); select * from test where '2' > '10'; -- 1 select * from test where '12' > '-13'; -- 1 select * from test where '1 ' > '-'; -- 1 select * from test where ')12' > '(13'; -- 1 Regards, Thomas On Sat, Oct 9, 2010 at 1:00 PM, Rami Ojares <[email protected]> wrote: > I give up. > I can not fathom a reasonable explanation for these results. > Why would sql spec require character comparison from right to left? > > - Rami > > On 8.10.2010 7:18, kensystem wrote: >> >> Here is another interesting one: >> >> PG> select ')12'> '(13'; -> false >> >> Same length, but it SUGGEST that 0x29> 0x28 - I though those were too >> low in the charpage to have different collations(?) >> >> Then consider: >> PG> select ')12'> '(12'; -> true >> >> All this makes me wonder, does the sql spec require var/char >> comparisons from right to left and PG is doing it the 'spec' way? >> > > -- > You received this message because you are subscribed to the Google Groups > "H2 Database" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/h2-database?hl=en. > > -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/h2-database?hl=en.
