在ORALCE中如果你要判断一个字符串是否在一个表的字段中存在,你可以用instr()函数。
例如:
SELECT *
FROM M_ZAIKO
WHERE instr(ISBNTCD, 'AA' )>0

解决方案 »

  1.   

    the most common way is :select * from M_ZAIKO 
    where ISBNTCD like '%AA%';
      

  2.   

    contains好象是oracle intermedia用到的
    错误中说的很清楚要对使用contains的列建立index
      

  3.   

    Purpose
    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. 帮助中查到的,希望对你有帮助。