It can.  You declare the column to have a collation of NOCASE.  In the case of 
the select you gave which does not d=contain any wildcards (and therefore is 
not needful of LIKE) you can pronounce:

SELECT trim(name) FROM names WHERE name = 'Ben' and name = 'benjamin' collate 
nocase


However since it is impossible for a string to equal both 'Ben' and 'benjamin" 
and the same time, even if both comparisons are case and accent insensitive, 
you will always get no rows returned.

> -----Original Message-----
> From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org]
> On Behalf Of Anony Mous
> Sent: Wednesday, 11 January, 2017 10:55
> To: sqlite-users@mailinglists.sqlite.org
> Subject: Re: [sqlite] LIKE and the like and SIMilarity
> 
> Here's the problem as I see it (demo SQL is lame, but makes the point):
> 
>     SELECT trim(name) FROM names WHERE name LIKE('Ben') and name
> ILIKE('benjamin')
> 
> ...you can't do that in SqLite using a pragma, can you? If you can, I'd
> sure like to learn how.
> 
> If you can't, not to belabor the point, but you *can* do it in PostgreSQL,
> and while I'm not suggesting that SqLite should strive for the
> sophistication of PostgreSQL, the issue of SQL programmer ability to use,
> and mix, both case-sensitive and case-insensitive means is pretty basic
> stuff.
> 
> If the SQL spec for LIKE is "collation of characters", fine, by all means
> implement the capability another way that uses more reasonable means. I
> don't care what it is called at *all*.
> 
> The lack of the *ability* really can't be defended. It's down to "how to
> do
> it", not "why do it."
> 
> Textual data has case. Sometimes that matters. Sometimes it doesn't. A
> database engine should be able to cleanly deal with that without forcing
> the programmer to write custom code.
> 
> --Ben
> fyng...@gmail.com
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users



_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to