Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Interesting Question - how do we do it? (fwd)
Curtis D. Carr <ccarr_at_NEBULA.LIB.VT.EDU> wrote:
> > I'm searching the db for resources (a table). I'm looking for:
> > grade(column in resources) = 7, 8, or 9
> > subject(column in resouces linked to a subject table) = algebra
> or geometry
> > I do an or search on everything above. Now, when I get my results
> > back, they want them weighted using a very simple scoring method,
> > where each hit's score = the number of categories of things it
> > matched. I then need to present the results in score ranked
> > order.
This will run SLOWLY, but may do some of what you wanted if you can wait for it. (Caveat, caveat.) My tendency would be to do the individual queries and then do post-processing in a procedural language (even PL/SQL).
select
id,
decode( grade, 7,1, 8,1, 9,1, 0 ) + decode( subject, 'algebra',1, 'geometry',1, 0 ) + decode( activity, 'real world problems',1, 0 ) + decode( connections, 'all',1, 0 ) "sortvar"from resources
En paz,
Steve
--
Stephen W. Thompson, U. of PA, Data Administration, 215-898-1236, WWW has PGP
thompson@isc.upenn.edu URL=http://pobox.upenn.edu/~thompson/index.html
Received on Thu Jan 25 1996 - 14:52:02 CST
![]() |
![]() |