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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Pattern matching in Oracle.

Re: Pattern matching in Oracle.

From: Dan <djb0x7736d658_at_scream.org>
Date: 26 Aug 2000 08:30:41 GMT
Message-ID: <slrn8qf0gn.ako.djb0x7736d658@v2000.scream.org>

Roland Dunn <roland_dunn_at_hotmail.com> wrote:
> Wonder if anyone can help.
>
> I have a data set where potentially one record could have upto 100 numerical
> fields, each numercial field being a floating point number between say 0 and
> 5.
> I would like to run a query whereby I say something like: find me the
> records where field 20 has a value of 3.5 +/- 0.05, field 80 has a value of
> 2.99 +/- 0.02, field 56 has a value of 1.34 +/- 0.04. This query may include
> all fields.

Like...

  Select * from database
  where field20 > '3.45' and field20 < '3.55'   and field56 > '1.3' and field56 < '1.38'   and field80 > '2.97' and field80 < '3.01';

Something like that. You might want to use =< and >= (or are they => and <= maybe? I can't remember) to specify that those are inclusive ranges... I don't know whether SQL has a construct for

    where '3.45' < field20 < '3.55'
which would be slightly more elegant.

-Dan

-- 
Dan Birchall - Palolo Valley, Honolulu HI - http://dan.scream.org
Post your reviews; get paid: http://epinions.scream.org/join.html
Free web-based e-mail: http://www.themail.com/ref.htm?ref=1163079
My address expires - take out the hex stamp if your reply bounces
Received on Sat Aug 26 2000 - 03:30:41 CDT

Original text of this message

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