----- Original Message ----- 
From: "Simon Slavin" <[email protected]>
To: "General Discussion of SQLite Database" <[email protected]>
Sent: Tuesday, March 30, 2010 8:12 PM
Subject: Re: [sqlite] Case-sensitivity, performance and LIKE


>
> On 31 Mar 2010, at 12:51am, Rashed Iqbal wrote:
>
>> Is there a way to make SQLite queries case-insensitive?
>>
>> For example my query is:
>>
>> SELECT * from Customers WHERE LastName = 'Shaw' AND FirstName = 'Gioia'
>>
>> and I want to be able to get same results no matter if the case is good
>> in the DB or not or in the query.
>
> You need a change from the standard collating system.  Take a look at 
> section 6.2 of
>
> http://www.sqlite.org/datatype3.html
>
> I haven't tried this myself but I think that if you define a column as
>
> columnName TEXT COLLATE NOCASE
>
> then all sorting and SELECT queries on it will ignore case.
>
You don't even have to change the defined collation as you can impose the 
NOCASE collation in the SELECT statement as:

SELECT * from Customers WHERE LastName = 'Shaw' COLLATE NOCASE AND FirstName 
= 'Gioia' COLLATE NOCASE;

Tom

_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to