Help with SQL statement....

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


[Quoted] 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 CEST

Original text of this message