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 -> SQL query problem

SQL query problem

From: Bob McConnell <bobmc_at_cyberramp.net>
Date: 1998/02/26
Message-ID: <34f5e153.178726084@news.internetmci.com>#1/1

I am trying to resolve the following query problem:

table 1 contains 2 fields containing product discriptions such as:

     field 1 field 2
    apples oranges
    apples apples
    oranges bananas
    pears apples
etc.
 the fields may or maynot contain the same description.

table 2
  field1 field2
 apples 10
  pears 20
 bananas 30
 oranges 50

The problem is to select field 1 and 2 from table 1 and order the results by values found in table 2

I would like to do some sort of join where my select of all records from table 1 would return something liker:

    apples oranges 10 50
    apples apples 10 10
    oranges bananas 50 30
    pears apples 20 10
allowing me to order the final results to be

    apples apples
    pears apples
    apples oranges
    oranges bananas

Can someone point me in the right direction?

Thank,
Bob Received on Thu Feb 26 1998 - 00:00:00 CST

Original text of this message

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