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 -> Help with SQL statement....

Help with SQL statement....

From: mAd hAcker <madhackerboy_at_hotmail.com>
Date: 2000/06/27
Message-ID: <_H965.17654$Pz6.122424@news1.mts.net>#1/1

Not having written SQL statements in Oracle before, I'd like to ask for some help from you guys....

I have a table which has codes for states and for products......these are related to a state table and product table, which have the name of the state and product (which are what I want to display - instead of the obscure code) Now, I know that this is a join query.....but what exactly is the syntax? Here's what I have.....

CURSOR c_sales
IS
SELECT sales.date_started, products.name, states.name,

      sales.sale_length, sales.price
FROM states, sales, products
WHERE sales.product_id = products.product_id AND state.state_code = sales.state_code
ORDER BY actual_cost
 ;

Is this close? What am I missing? Thanks in advance for any help!! Received on Tue Jun 27 2000 - 00:00:00 CDT

Original text of this message

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