Chintan Gor
Chintan Gor

Reputation: 1072

Oracle parsing string for separators

I have one table in Oracle 11g database

I am storing some value like '|' separated mode as below

Table: ABC
FIELD: XYZ

Values :

9
1|12
52
5|112

Now I want to find ID from those values

I used REGEXP_LIKE but it will get all the rows containing value

Suppose I will search for 5 then it will give result for '5' and also for '52'

please help me to search particulate id from this field

Thanks

Upvotes: 0

Views: 95

Answers (1)

Noel
Noel

Reputation: 10525

Try this.

select * from table_name
 where '|' || column_name || '|' like '%|' || 'search_string' || '|%';

Sample here.

Upvotes: 2

Related Questions