SQL Help?

From: Barry Prentiss <thebear_at_antispam.stanford.edu>
Date: Thu, 16 Aug 2001 14:30:26 -0700
Message-ID: <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 Thu Aug 16 2001 - 23:30:26 CEST

Original text of this message