Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle wildcard search on alphanumeric fields

Re: Oracle wildcard search on alphanumeric fields

From: TurkBear <jgreco1_at_mn.rr.com>
Date: Fri, 01 Mar 2002 12:03:35 -0600
Message-ID: <6agv7u06uebu5006vk5cj0kidjm68a7f2l@4ax.com>


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
T792130 Financial Operations
T792130 Financial Operations
T792101 ABC Management
T792132 Accounting Systems
T792130 Financial Operations
T792101 ABC Management
T792123 (I) Off of Contract Management T792132 Accounting Systems
T792135 (I) R/W Accounting
T792132 Accounting Systems

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US