I have a table with few columns in SQLite. I have two columns that I need to use for querying this table (code, Description). Both of these have the COLLATE NOCASE when creating the tables as below:
CREATE TABLE [AuditEvent] (
    "Code"      char(4) NOT NULL COLLATE NOCASE,
    "Description"       nvarchar(255) NOT NULL COLLATE NOCASE,
    "AuditEventPK"      guid NOT NULL,
    PRIMARY KEY ([Code])
);
When I query the table using the code I get no results
select * from auditevent where code = 'add'    -- does not return any value
select * from auditevent where description = 'add' -- returns the right record.
However when I query the table using the description colomun, I get the results.
In some cases, I have to use the CODE, but it is not returning anything. Any idea??
 
    