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 -> Re: SQL question

Re: SQL question

From: OraGod <jsilvey_at_texas.net>
Date: 1998/03/31
Message-ID: <3520954D.EF7216DC@texas.net>#1/1

Ron,

When you have multiple tables linked together, and you want to display a record from one side that does not have a record on the other, use the "left outer join" syntax. It is implemented in Oracle as (+) on the short side, which is that side that will not have a record to match the record existing in the other table. The (+) just displays null fields where the child record would be.

Ron Schnell wrote:

> Hi,
>
> I'm a beginner at SQL, but thought I had a good handle on things, until
> this report problem came up. It seems like it should be possible, but
> I can't figure out how to do it. Is it possible with one query?
>
> Here is a simplified version of the problem:
>
> I have 2 tables, one called 'customer' and one called 'transactions'.
> The customer table has customer numbers and last names of customers, and
> the transaction table has customer numbers and dates for each time each
> customer has used the "system" (one row for each access).
>
> I would like to create a report to print out the name of each customer
> and the last time they accessed the system. Note that some of the
> customers have never accessed the system, but I still want to print out
> their name (and blank or something else in the last access column).
>
> Seems like it should be easy, but I can't figure it out.
>
> Any help would be appreciated.
>
> Sincerely,
>
> #Ron
> ronnie_at_space.mit.edu
Received on Tue Mar 31 1998 - 00:00:00 CST

Original text of this message

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