首先想到的就是contains,contains用法如下:

select * from students where contains(address,  ‘beijing’)  

但是,使用contains谓词有个条件,那就是列要建立索引,也就是说如果上面语句中students表的address列没有建立索引,那么就会报错。

好在我们还有另外一个办法,那就是使用instr,instr的用法如下:

 select * from students where instr(address, ‘beijing’) > 0  

另外,还有个笨办法,那就是使用like,说到这里大家应该知道怎么做了吧:

 select * from students where address like ‘%beijing%’  

 

 

相关文章:

  • 2022-12-23
  • 2021-08-26
  • 2022-01-08
  • 2022-01-17
  • 2021-09-17
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
  • 2021-05-13
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案