Re: SQL Help?

From: Date: Thu, 16 Aug 2001 22:39:15 +0000
Subject: Re: SQL Help?
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-11465@lists.php.net to get a copy of this message
Sorry, forgot to mention that I'm on an Oracle 8.1.6 db... Thx, Barry "Barry Prentiss" <thebear@antispam.stanford.edu> wrote in message news:20010816213254.55720.qmail@pb1.pair.com... > 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 > >

« previous php.db (#11465) next »