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: How to add a weight factor to a query?

Re: How to add a weight factor to a query?

From: Calvin Crumrine <Calvin_Crumrine_at_dced.state.ak.us>
Date: Mon, 29 Jan 2001 09:21:56 -0900
Message-ID: <3A75B4C4.47652192@dced.state.ak.us>

jethro_harding_at_my-deja.com wrote:

> Hi,
>
> How do I add a weight factor to a query? For example, take the
> following query:
>
> SELECT table.field1, table.field2, table.field3
> FROM table
> WHERE field1 = 'value1'
> AND field2 = value2
> OR field3 = value3
>
> What I would like to do now is give each test a factor of importance.
> So (field1 = 'value1') should be the most important, let's say 60%, the
> other two should be of importance for 20% each.
>
> Can anybody help me with this? Thanks very much in advance for your
> time and effort!
>
> Jethro Harding

A little explanation of how this would be used might help. You either select or don't select any given record. It's either 100% or 0%, based on the where clause. Weights are generally used (IME) in determining when a threshhold is crossed. E.g., Value=TRUE if (value1*.6 + value2*.2 + value3*.2) > .5 or something like that. Maybe you want it to apply to a range? E.g. WHERE (NOT field1 > value1 * 1.4 and NOT field1 < value1 * .6) etc. Received on Mon Jan 29 2001 - 12:21:56 CST

Original text of this message

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