最近用了MySQL+ibatis 做项目

问题描述:

在SQL里 用到了 a.name like ##%searchName%##

searchName=test_1

发现出来的结果:

test_1,  test01

原来下划线_在mysql中是特殊符号,代表任意一个字符*

解决方案:

code里面需要对下划线_做转义: test_1 ==> test\_1

问题解决。

相关文章:

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