Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> HOWTO: Use result of and EXISTS test in SELECT list?
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