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: Outer join problem

Re: Outer join problem

From: sack <news_at_webpre.com>
Date: 9 Feb 2000 23:54:49 GMT
Message-ID: <87suo9$4u7$0@216.39.144.218>

"s. hunter" wrote:
>
> Sorry, Pierre, I don't think I explained myself very well!
>
> The results I want returned are all the descriptions in table B,
> together with their values from table A (the numerical column), but only
> if the seqid in A is equal to a given value, otherwise I want a null.
>
> So what you suggest would work in that case because it depends on a
> seqid being present in both cases (I think!)
>

Well, it sure is a strange query, but I guess I understand now I think you want

SELECT a.seqid, b.description, a.numerical_column from a, b
where a.catid(+)=b.catid
and a.seqid(+)='12345'
order by b.description
/

works with the example somebody else posted

I.e.

SQL> l
  1 SELECT e.sal, d.loc, e.hiredate
  2 from emp e, dept d
  3 where e.deptno(+)=d.deptno
  4* and e.sal(+)='1500'
SQL> /        SAL LOC HIREDATE
---------- ------------- ---------

           NEW YORK
           DALLAS
      1500 CHICAGO       08-SEP-81
           BOSTON
Received on Wed Feb 09 2000 - 17:54:49 CST

Original text of this message

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