-1

I have following query for Czech language:

select Id,Name 
from Account 
where Name like '%Še%'

it will return me correct result. But if I change Š to š in my query:

select Id,Name 
from Account 
where Name like '%še%'

It returns nothing. Is this a sqlite bug?

spspli
  • 3,128
  • 11
  • 48
  • 75
  • The data in the Db is UPEERCASE LOWERCASE or BOTH ? – Marco Nov 08 '16 at 18:05
  • http://stackoverflow.com/questions/973541/how-to-set-sqlite3-to-be-case-insensitive-when-string-comparing – Marco Nov 08 '16 at 18:05
  • The data in the Db is Uppercase. And I find if I run below query: select upper('še') it returns šE – spspli Nov 08 '16 at 18:21
  • I tried this too, it doesn't work neither. select Id,Name from Account where Name like '%še%' COLLATE NOCASE – spspli Nov 08 '16 at 18:23

1 Answers1

4

https://www.sqlite.org/lang_expr.html#like:

Important Note: SQLite only understands upper/lower case for ASCII characters by default. The LIKE operator is case sensitive by default for unicode characters that are beyond the ASCII range. For example, the expression 'a' LIKE 'A' is TRUE but 'æ' LIKE 'Æ' is FALSE. The ICU extension to SQLite includes an enhanced version of the LIKE operator that does case folding across all unicode characters.

So the solution to your problem would be to get an SQLite version with the ICU extension.

rindeal
  • 993
  • 11
  • 16