Having trouble with join - Mailing list pgsql-sql

From G. Anthony Reina
Subject Having trouble with join
Date
Msg-id 360AE8A5.15CDE741@nsi.edu
Whole thread Raw
List pgsql-sql
I have a subquery that I'd like to make a join instead to see if it is
any faster.

subquery:  select distinct cell from center_out_cell where rep in
(select rep from center_out_opto where marker = 5);

All this does is find the occurrences of 'cell' that have 'marker' = 5.
However, 'cell' is defined in table center_out_cell and 'marker' is
defined in table 'center_out_opto'. Both tables have 'rep' so that ties
them together. The subquery gives me the correct results.

I tried this for a join but didn't get the right result:

select distinct cc.cell from center_out_cell cc, center_out_opto co
where co.marker = 5 and co.rep = cc.rep;

Can anyone tell me what I'm doing wrong?
Does this sound more like a subquery or a join?

Thanks
-Tony
--

                        ( @@ )
 ////////////////////oOO*(__)*OOo///////////////////////
//                                                    //
// G. Anthony Reina, MD                               //
// The Neurosciences Institute                        //
// 10640 John Jay Hopkins Drive                       //
// San Diego, CA   92121  USA                         //
//                                                    //
// Voice: (619) 626-2000     FAX: (619) 626-2199      //
// E-mail: reina@nsi.edu                              //
//                                                    //
///////////////////////////////////////////////////////

pgsql-sql by date:

Previous
From: "G. Anthony Reina"
Date:
Subject: I can't seem to set the -B option on the postmaster over 3000
Next
From: James Olin Oden
Date:
Subject: Re: [SQL] C compiler error when using PostGres