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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Interesting SQL Statement Problem...

Re: Interesting SQL Statement Problem...

From: Galen Boyer <galenboyer_at_yahoo.com>
Date: 2000/07/23
Message-ID: <u66pwtjlj.fsf@yahoo.com>#1/1

SELECT T1.col2,

       T2.col2
  FROM tab1 T1,

       tab1 T2
 WHERE T1.col1 = 1
   AND T2.col1 = 2;

You aren't joining anything, so I think your strategy would involve a decode and a single table query.

Try something like this;

select decode(col1,1,col2,NULL), decode(col1,2,col2,NULL) from tab1;

BTW, I just went to send you the reply and my newsreader told me that you had posted this to many newsgroups, so I added this extra note. Indiscriminate Cross-posting is bad practice and you will piss alot of people off, and my answering you may do that as well. Be more discriminate in the future. People notice that you have done this, and with sophisticated newsreaders (which alot of the best posters will have), any more posts in the future by you, may not even be seen because these people will tell their newsreader to obliterate you from their view of the newsgroup.

-- 
Galen Boyer
Database Architect
Primix Solutions, www.primix.com
Received on Sun Jul 23 2000 - 00:00:00 CDT

Original text of this message

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