Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle wildcard search on alphanumeric fields
If just at positions 4 and 5 then
use
like '___01%'
( Note there are 3 underlines then the 2 numbers then the % sign)
For instance to find all department number that have 31 in the 4th and 5th positions:
SQL> select dept_nbr,dept_nm from hr_cur_rptng 2 where dept_nbr like '___21%';
DEPT_NBR DEPT_NM
---------- ------------------------------T792140 Materials Management
etc...
hth,
jholakowski_at_nielsenco.com (Jeff Holakowski) wrote:
>I tried using '%01%' already, but there could be a combination like
>v010102 or b030101, where I would like to capture only 01 at positions
>4 & 5.
>
>damorgan <dan.morgan_at_ci.seattle.wa.us> wrote in message news:<3C7EAA56.2F5E9B4C_at_ci.seattle.wa.us>...
>> '%01%'
>>
>> Daniel Morgan
>>
>>
>>
>> Jeff Holakowski wrote:
>>
>> > Hi,
>> >
>> > I am trying to get a list of values in an alphanumeric field and I'm
>> > having trouble using the '%' and '_' characters. I would like to get a
>> > listing where all values in "xxx01xx" are displayed (x being
>> > variable). I've used "where location like '___01__' but this returns
>> > no rows. Any suggestions?
>> >
>> > Thanks
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World! Check out our new Unlimited Server. No Download or Time Limits! -----== Over 80,000 Newsgroups - 19 Different Servers! ==----- Received on Fri Mar 01 2002 - 12:03:35 CST