Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL syntax

Status
Not open for further replies.
Mar 7, 2010
61
HI

I have a few tables. I am using Golden32 to write the SQL and retrieve from oracle database.

I have a table which I want all records to be displyed from irrelevant if there is data in the joined tables.

I have a table that this joins to main table where I want some data only when it exists, however the syntax I have used at the moment it is only being displyed if there is data in this other table. E.g. this table links to a price table and displays a price (there could be many prices but I have a clause indicating the idx of the price I want), but sometimes there is no price in this table so I want it to still displey the record in the main table when there isnt, but I cant get it to when I link to the price table whether I use a left or right outer join. I lose the record I want without a price entirely.

I also join this table to antoher table with a link to show the invoice details where there is a invoice idx on the order (main table), however currently it only shows the records that does have an invoice idx and not the ones that doesnt.

I also have one order from the order main table that could have many linked invoices. I want it to display the order inforamtion on one record only but all the invoices, so like a distinct display on the order information. I am not sure how to do this.

Any help woudl be appreciated.

Thanks


 
you will probably want to use LEFT OUTER JOINs

by the way, you should also probably repost your question in an Oracle forum, as Oracle SQL is often quite different from SQL Server SQL

r937.com | rudy.ca
Buy my new book Simply SQL from Amazon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top