select * from table   where target_text like "3";

等价于

select * from table   where target_text = "3";

 

查找出来的都是target_text  为 3 的数据

 

select * from table   where target_text like "%3%";

查找出来的都是target_text  包含 3 的数据

 

数据库本身大小写需要在建表的时候指定某个字段的大小写是否敏感,如果要强制下:

create  table  table_name(    
     name varchar (20) binary      
);  

如果建表的时候忘记了大小写敏感,mysql可以怎么写:

select * from table_a where source_text =  BINARY 'booK';

相应的ibats可以这么写

<isNotEmpty property="sourceText" prepend="AND">
source_text = BINARY #sourceText#
</isNotEmpty>

 

相关文章:

  • 2021-12-08
  • 2021-06-03
  • 2021-11-15
  • 2021-12-29
  • 2021-12-16
  • 2021-05-27
  • 2021-10-05
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-10
  • 2021-10-28
  • 2022-12-23
  • 2022-02-02
  • 2022-12-23
  • 2021-05-31
相关资源
相似解决方案