Tiago Dionizio wrote:

The collation sequence "binary" was not being used when i declared the column a without a type, but when i included the *text* type the collation sequence was used to sort the result. Is this the expected behaviour?


The collating sequence is only use to compare objects of type TEXT. Numeric values always compare in numeric order. When you made the column type TEXT, that coerced the numeric values into text values and thus they began to be compared as TEXT instead of NUMERIC.

See http://www.sqlite.org/datatype3.html

This behavior may seem odd and needlessly complex.  But it is
intentional.  SQLite 3 is designed for maximum compatibility with
other SQL database engines and the behavior above is basically
what they all do.  You don't notice the goofiness of this
behavior in other database engines because they are all statically
typed whereas SQL is dynamically typed.  The dynamic typing gives
you more flexibility which allows you to better see some of the
bad design decisions in the SQL language.


-- D. Richard Hipp -- [EMAIL PROTECTED] -- 704.948.4565



Reply via email to