repeating records
| From: | Adv. Systems Design | Date: | Wed, 30 Aug 2000 15:35:55 +0000 |
| Subject: | repeating records | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-2485@lists.php.net to get a copy of this message | ||
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/