View Single Post

   
  #2 (permalink)  
Old 02-28-2008, 09:11 AM
Peter H. Coffin
 
Posts: n/a
Default Re: replacing a programming loop with the correct JOIN

On 16 Feb 2007 15:20:16 -0800, christopher@dailycrossword.com wrote:
> select progs.title, progs.prog_id, events.title, events.event_id,
> questions.content, questions.question_id, answers.content,
> answers.answer_id from progs INNER JOIN (events,questions,answers) on
> (progs.prog_id=events.prog_id AND events.event_id=questions.event_id
> AND questions.question_id=answers.question_id) where
> progs.status="initializing" order by
> progs.prog_id,events.event_id,questions.question_i d,answers.answer_id;
>
> can one of y'all gurus advise me whether this will always give me one
> line for each answer, provided the relationships are correct?


It looks like it, yes.

--
Premature optimization is the root of all evil.
-- Sir Tony Hoare
Reply With Quote