On Thu, Nov 6, 2014 at 2:15 PM, Michael Suodenjoki <
michael.suodenj...@intrasoft-intl.dk> wrote:

> Hi,
>
> I'm a bit disoriented by the following result - here using SQLite command
> shell:
>
> sqlite> .version
> SQLite 3.8.6 2014-08-15 11:46:33 9491ba7d738528f168657adb43a198238abde19e
> sqlite> CREATE TABLE test( col TEXT COLLATE NOCASE );
> sqlite> INSERT INTO test VALUES ('b'), ('A'), ('B'), ('a');
> sqlite> SELECT * FROM test;
> b
> A
> B
> a
> sqlite> SELECT * FROM test WHERE col<'b';
> A
> a
> sqlite> SELECT * FROM test WHERE LTRIM(col)<'b';
> A
> B
> A
>
> To me this result of the last SELECT statement is a bit unexpected. There
> are no space in the values, but using LTRIM function somehow removes
> collation (and uses the default BINARY collation). I would have expected
> the same result in the last two SELECT statements.
>
> Is this an error or something I haven't understood?
>

Works as designed.  See https://www.sqlite.org/datatype3.html#collation and
in particular the three rules under section 6.1.



>
> /Mike
>
> PS. Is there a way to see the resulting/deduced collation of a SELECT
> statement?
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>



-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to