在SQLite中,对大小写是敏感的。那么SQLite怎么区分大小写查询呢,以下是三种解决方案:

方案一:使用大小写转换函数LOWER、UPPER

1.select * from test where UPPER(name) = 'ABC';
2.select * from test where LOWER(name) = LOWER('ABC');

方案二:在进行比较时强制声明不区分大小写

select * from test where name = 'ABC' COLLATE NOCASE;

方案三:创建表时声明该字段不区分大小写

create table test (_id Integer,name Text COLLATE NOCASE );

相关文章:

  • 2021-12-06
  • 2022-12-23
  • 2022-12-23
  • 2021-09-17
  • 2021-12-23
  • 2021-11-04
  • 2021-05-24
猜你喜欢
  • 2022-12-23
  • 2021-10-02
  • 2022-02-08
相关资源
相似解决方案