Why isn't my query case sensitive?
Select * from MyTable where name like '%Ann%'
shows record 1 correctly:
Record1= John, Ann, Jack
but shows also record 2:
Record2: Jack, Susanne, Jim
You could execute PRAGMA case_sensitive_like = on
, but this would affect all LIKEs used in your program, and disable any index optimizations for prefix searches.
A better idea would be to replace LIKE with GLOB:
SELECT * FROM MyTable WHERE Name GLOB '*Ann*'
the SQL LIKE is case-insensitive(thnks to CL ) So, on some SQL implementations you can do case Sensitive SQL query Searches
check this too: Case insensitive searching in Oracle
[Copied from rbedger's answer:]
You can use the UPPER keyword on your case insensitive field then upper-case your like statement
SELECT * FROM mytable
WHERE caseSensitiveField like 'test%'
AND UPPER(caseInsensitiveField) like 'G2%'