[prev in list] [next in list] [prev in thread] [next in thread]
List: sqlite-users
Subject: Re: [sqlite] BETWEEN and explicit collation assignment
From: "James K. Lowden" <jklowden () schemamania ! org>
Date: 2013-08-29 23:35:14
Message-ID: 20130829193514.150978f8.jklowden () schemamania ! org
[Download RAW message or body]
On Tue, 27 Aug 2013 21:00:50 -0500
Nico Williams <nico@cryptonector.com> wrote:
> Of course, lacking a syntax for associating collations with string
> literals there will be times when some, or even all of the operands to
> an operation that needs collation information, is missing. In such
> cases the collation information of some operands could be used to cast
> the others, or lexical clues might be needed, or a default might be
> provided.
There's no need to qualify string literals, as it turns out. SQLite
makes a reasonable choice in that context. When comparing a string
literal to a column, the literal (in effect) takes on the collation of
the column.
sqlite> create table t ("binary" char collate binary, "rtrim" char
collate rtrim, "nocase" char collate nocase);
sqlite> insert into t values ('A', 'A ', 'A');
sqlite> select * from t where "nocase" = 'a' and "rtrim" = 'A';
binary rtrim nocase
---------- ---------- ----------
A A A
--jkl
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic