在ORALCE中如果你要判断一个字符串是否在一个表的字段中存在,你可以用instr()函数。
例如:
SELECT *
FROM M_ZAIKO
WHERE instr(ISBNTCD, 'AA' )>0
例如:
SELECT *
FROM M_ZAIKO
WHERE instr(ISBNTCD, 'AA' )>0
解决方案 »
- Oracle 11G 安装时要要一个客户标识码,这个怎么解决?
- 急!请教大家,为什么创建的物化视图经常失效?
- 读取表字段出现乱码,急~~~
- 如何输出Oracle存储过程Cursor
- 急问!一句动态sql总是报错:缺失表达式
- 刚刚写的一个函数,test后没有问题,但怎么不能用在sql中???~~~~~~~~~~~~~~~~~~
- 安装oracle为什么总是出错??
- easyloader 11导入tab 数据导oracle11g中文出现乱码
- 如何升级oracle8.0.5 yo Oracle 8.1.7
- 小弟刚刚开始学习oracle,求教用什么书比较合适?
- oracel 的問題
- export 问题,在线等待,问题解决后马上结帐!
where ISBNTCD like '%AA%';
错误中说的很清楚要对使用contains的列建立index
Use the CONTAINS operator in the WHERE clause of a SELECT statement to specify the query expression for a Text query. CONTAINS returns a relevance score for every row selected. You obtain this score with the SCORE operator. Syntax
CONTAINS(
[schema.]column,
text_query VARCHAR2,
[label NUMBER])
RETURN NUMBER;
[schema.]column
Specify the text column to be searched on. This column must have a Text index associated with it. text_query
Specify the query expression that defines your search in column. label
Optionally specify the label that identifies the score generated by the CONTAINS operator. Returns
For each row selected, CONTAINS returns a number between 0 and 100 that indicates how relevant the document row is to the query. The number 0 means that Oracle found no matches in the row. Example
The following example searches for all documents in the in the text column that contain the word oracle. The score for each row is selected with the SCORE operator using a label of 1: SELECT SCORE(1) title from newsindex
WHERE CONTAINS(text, 'oracle', 1) > 0;Notes
The CONTAINS operator must always be followed by the > 0 syntax which specifies that the score value calculated by the CONTAINS operator must be greater than zero for the row to be selected. When the SCORE operator is called (e.g. in a SELECT clause), the operator must reference the label value. 帮助中查到的,希望对你有帮助。