searching a column
532107Nov 16 2006 — edited Nov 16 2006Hi
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