首先想到的就是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%'
Tags: beijing address oracle 字符串 where
文章來源: