Home >Database >Mysql Tutorial >编写查询条件不区分大小写的SQL语句_MySQL

编写查询条件不区分大小写的SQL语句_MySQL

WBOY
WBOYOriginal
2016-06-01 13:51:311089browse

1、先将数据库中该字段全部转为大写,然后用Upper()函数将条件转为大写:
select * from code_table_data t where Upper(t.DETAIL_DESC)=Upper('tr');
2、 模糊查询:在Java中将条件转为大写,然后将该变量放入百分号(%)之间!
select * from code_table_data t where Upper(t.DETAIL_DESC) like '%T%';

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn