[PHP-DB] repeating records From: Adv. Systems Design (asd_2000 <email protected>)
Date: 08/30/00

I have 3 tables: lesson, lesson_preq, and
preqs...basically each lesson has many prerequisites
(lesson_preq composed of lesson id and prereq id) and
the prerequisites are stored in preqs (prereq id and
prereq name).

Now I want to list all the lessons and have the name
appear for each prerequisite...the query below gives
me what I want, but each lesson is repeated for each
prerequisite...I would like to list the lesson only
once and have all prerequisites appear (in name) for
that lesson...since we do not have subselects...this
is kind of confusing...any ideas?

SELECT lesson.l_id, lesson.title, preqs.prereq
 FROM lesson, lesson_preq, preqs
 WHERE lesson_preq.preq_id=preqs.preq_id
 AND lesson_preq.l_id=lesson.l_id

Thanks

Luis

__________________________________________________
Do You Yahoo!?
Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe <email protected>
For additional commands, e-mail: php-db-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>