Re: SQL Help?

From: Steve Long <slong3_at_mediaone.net>
Date: Fri, 17 Aug 2001 02:36:18 GMT
Message-ID: <Cq%e7.1606$L8.23537_at_typhoon.jacksonville.mediaone.net>


use the DECODE function if there the column is guarantted to be not null, or use a combination of DECODE and NULVAL if the column can be null. any good SQL reference book will give you proper usage.

"Barry Prentiss" <thebear_at_antispam.stanford.edu> wrote in message news:3b7c3bd8$0$322$8eec23a_at_newsreader.tycho.net...
> Hi,
> Here's another SQL query problem:
>
> How do I construct a query that returns 1 if a value is present and zero
 if
> it is not, for a list of values returned in another query?
>
> i.e. select a.id, a.name, c.selected from table-with-id-and-name a,
> (select 1 as selected from another-table b if a.id = b.id
> or select 0 as selected from another-table b if a.id != b.id ) c;
>
> Thx in Advance,
> Barry Prentiss
>
>
Received on Fri Aug 17 2001 - 04:36:18 CEST

Original text of this message