Home » SQL & PL/SQL » SQL & PL/SQL » Reg: Outer Join........
Reg: Outer Join........ [message #189703] Fri, 25 August 2006 12:52 Go to next message
sidagam
Messages: 24
Registered: February 2005
Location: Hyderabad
Junior Member
Hi All,

I was stucked with below query.

SELECT
*
FROM
Table_A
, Table_B
WHERE
(
Table_A.f1 = Table_B.f1
AND
Table_B.Start_date > SYSDATE
AND
Table_B.End_date < SYSDATE
)

I want to put outer join on Table_B means.. The query is like
SELECT
*
FROM
Table_A
, Table_B
WHERE
(
Table_A.f1 = Table_B.f1(+)
AND
Table_B.Start_date > SYSDATE
AND
Table_B.End_date < SYSDATE
);

Because of the below 2 conditions the query is not working with outer join functionality.

Could you please tell me how to make the above query with OuterJoin.

Thanks & Regards,

Babu SRSB.
Re: Reg: Outer Join........ [message #189718 is a reply to message #189703] Fri, 25 August 2006 17:41 Go to previous messageGo to next message
scottwmackey
Messages: 505
Registered: March 2005
Senior Member
SELECT *
FROM table_a a
    ,(SELECT *
      FROM table_b
      WHERE start_date > SYSDATE
        AND end_date < SYSDATE) b
WHERE a.f1 = b.f1(+)
or
SELECT *
FROM table_a a
LEFT JOIN table_b b ON b.f1 = a.f1
                 AND b.start_date > SYSDATE
                 AND b.end_date < SYSDATE;
Re: Reg: Outer Join........ [message #189968 is a reply to message #189718] Mon, 28 August 2006 14:54 Go to previous message
sidagam
Messages: 24
Registered: February 2005
Location: Hyderabad
Junior Member
Thanks a lot Scott....

Babu SRSB.
Previous Topic: Unusable/Rebuild indexes
Next Topic: "Logon as a batch job" privilege - trying to import
Goto Forum:
  


Current Time: Wed Dec 07 20:48:03 CST 2016

Total time taken to generate the page: 0.05385 seconds