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

Home -> Community -> Usenet -> c.d.o.server -> HOWTO: Use result of and EXISTS test in SELECT list?

HOWTO: Use result of and EXISTS test in SELECT list?

From: Randy Baker <rsbakerZ_at_msn.com>
Date: 1998/03/02
Message-ID: <6df5nt$99r@suriname.earthlink.net>#1/1

In Access and SQL Server, I can use an abomination of the following form:

select column1, column2, (EXISTS SELECT <any SQL statement>) as column3 from <table, join, query, etc>.

The column to which the EXISTS clause is bound is 0 if the EXISTS clause is false, non-zero otherwise. Is there an easy way to do this in Oracle?

Note that in any situtaion in which I use this, the SELECT clause within the the EXISTS table is dependent on the tables being queried in the main SELECT, so I can substitute a left/right outer join and test for NULL in the joined column.

--
Randy Baker (remove Z from address in email replies)
Received on Mon Mar 02 1998 - 00:00:00 CST

Original text of this message

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