Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

searching a column

532107Nov 16 2006 — edited Nov 16 2006
Hi

I have a column say "DAYS"
contains data like

1
12
1234
123
156
245
26
236
2456

and i need to get the data of this column.
user just enters like 123 then i should get 1, 12, 1234, 123, 156, 245 26, 236 and 2456.
and i f user enters just 1 we should get 1, 12, 1234, 123, 156.
and if user enters 3 then 1234, 123, and 236 has to be fetched.

i have tried using INSTR and wildcards in LIKE in a single query.

my version is like

SELECT OPERATING_DAYS
FROM CARRIER_SCHEDULES_DTL
WHERE (OPERATING_DAYS LIKE '%1%2%3%'
OR INSTR('123', OPERATING_DAYS) > 0);

please provide me know if you have any efficient way of dealing this type of search.

Thanks in advance
-KR
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 14 2006
Added on Nov 16 2006
16 comments
341 views