Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Problem with Outer Join

RE: Problem with Outer Join

From: kkennedy <kkennedy_at_firstpoint.com>
Date: Thu, 22 Aug 2002 09:03:34 -0800
Message-ID: <F001.004BD026.20020822090334@fatcity.com>


SELECT year_date, to_char(attend_date, 'hh:mi:ss' )

     FROM A, B
     WHERE to_char(year_date, 'dd-mm-yyyy') = to_char(attend_date(+),
'dd-mm-yyyy') and employee_id(+) = 123;

You must outer join on all the columns.

Kevin Kennedy
First Point Energy Corporation

If you take RAC out of Oracle you get OLE! What can this mean?

-----Original Message-----
Sent: Thursday, August 22, 2002 5:38 AM
To: Multiple recipients of list ORACLE-L

Hi,

In our employee's attendance application the attendance data is stored in table 'A' including employee ID and attendance date & time. Another table 'B' has one column with dates of current year (365 records). For the sake of simplicity, other fields are ignored.

Table: A

    Employee_ID
    Attend_date (date with time)

Table: B

    year_date (one record each for a day of current year i.e., 365 records)

In a report (single employee at a time) showing all dates of the year and in front of it whether the employee was present or not we are running the following query. Assume that table A has 15 records of employee ID 123, the query should return 365 records with 15 records telling the time but it returns 15 records only.

SELECT year_date, to_char(attend_date, 'hh:mi:ss' )

     FROM A, B
     WHERE to_char(year_date, 'dd-mm-yyyy') = to_char(attend_date(+),
'dd-mm-yyyy') and employee_id = 123;

To my understanding this is perhaps because of the filter employee_ID=123. What would be the query to get the required result?

TIA! Aleem
--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Abdul Aleem
  INET: dmit_at_beaconhouse.edu.pk

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: kkennedy
  INET: kkennedy_at_firstpoint.com
Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Thu Aug 22 2002 - 12:03:34 CDT

Original text of this message

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