美文网首页
sqlite常用sql

sqlite常用sql

作者: 自然V简单 | 来源:发表于2017-10-18 14:33 被阅读14次

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默认即为忽略大小写匹配字符串

相关文章

网友评论

      本文标题:sqlite常用sql

      本文链接:https://www.haomeiwen.com/subject/xrxeuxtx.html