通过sql查询语句,查询某个字段中包含特定字符串:

 

例子:查询e_book表的types字段包含字符串"3",有下面4种方式

select * from e_book where types like "%3%";
select * from e_book where find_in_set('3', types);
select * from e_book where locate('3', types);
select * from e_book where INSTR(types,'3');

第2、3中方式相对速度较快

 

相关文章:

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