Re: Help with SQL statement....

From: Matt B. <mcb_at_fightspam.sd.znet.com>
Date: 2000/06/27
Message-ID: <slj3d8ltjev59_at_corp.supernews.com>#1/1


"mAd hAcker" <madhackerboy_at_hotmail.com> wrote in message news:_H965.17654$Pz6.122424_at_news1.mts.net...
> 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!!

Looks fine to me but just for neatness, put the semicolon right after "actual_cost".

Are you getting errors at compile time or runtime?

-Matt Received on Tue Jun 27 2000 - 00:00:00 CEST

Original text of this message