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 -> SQL Strategy

SQL Strategy

From: Craig Despres <craig_at_vtpartners.com>
Date: Wed, 14 Mar 2001 00:44:27 GMT
Message-ID: <L9zr6.25618$Xt3.3843102@news1.rdc1.az.home.com>

I have a question on the best function, tool, query or method to accomplish the following:

Let's say I have a table with col1, col2, col3

And I want to return all rows where any or all of my criteria match and I would like the results sorted in order of how many criteria matched. So, for example:

if my search criteria is: col1 = val1, col2 = val2, and col3 = val3

I want all rows where all 3 match listed first, then all rows where 2 of the 3 match
then all rows where at least one match

I would prefer to do this in a single query (without too many sub queries) since the table we are hitting will be rather large) Also, are there any build in methods of SQL functions in Oracle that would allow me to do this?

Any and all suggestions would be extremely appreciated.

Craig Received on Tue Mar 13 2001 - 18:44:27 CST

Original text of this message

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