1. 特定列忽略大小写存储查询
create table if not exists ABORT_REASON (abortreasonid int primary key, ABORTREASON text unique collate nocase, ORDER_FLAG int not null);
2. 测试
INSERT INTO ABORT_REASON(abortreasonid,ABORTREASON,ORDER_FLAG) VALUES (1,'abc',0);
select * from ABORT_REASON where ABORTREASON='ABC';
3. 如果只是偶尔需要忽略大小写查询
select * from ABORT_REASON where ABORTREASON='occupant became abusive' collate nocase;
4. like默认即为忽略大小写匹配字符串
网友评论