0

so I'm stumped here. I'm using Oracle 12.2.

Say I have 2 records in table "t" where the SEARCH_NAME column is indexed by type CONTEXT:

SEARCH_NAME
-----------------
REED, JAMES D
REED, JAMES J

I want to search for the first record (REED, JAMES D) using the CONTAINS operator. I would've expected this to work, but it does not as it will return both records. Anyone have any idea how to get only the first?

SELECT search_name
  FROM contacts 
 WHERE CONTAINS(search_name, 'REED\, JAMES D') > 0;

1 Answers1

0
SELECT search_name
  FROM contacts 
 WHERE CONTAINS(search_name, 'REED\, JAMES D', 1) > 0;

Find more on:

Contains for String

How contains works

Ashish Mishra
  • 704
  • 1
  • 6
  • 20