Results 1 to 2 of 2

Thread: outer join

  1. #1
    Join Date
    Oct 2003
    Posts
    51

    Unanswered: outer join

    I have the following tables:
    GL_DEPT
    ----------
    deptno status
    ----------------------
    10 Active
    20 Active
    30 Inactive
    40 Inactive
    50 Inactive

    Transaction table
    ----------------------
    deptno volume_Date
    -----------------------------
    30 20-feb-2005
    40 20-feb-2005
    20 21-feb-2005
    10 21-feb-2005

    i want the output like this
    -----------------------------
    To pick out the inactive records from gl_dept and the records from transaction table where the volume date is 20-feb-2005.
    sampath gowri

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    How about this? I'd say you don't need outer join at all ...
    Code:
    SELECT d.deptno 
    FROM transaction t, dept d
    WHERE d.deptno = t.deptno
      AND d.status = 'Inactive'
      AND t.volume_date = '20-feb-2005';

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •