Date: 08/30/00
- Next message: Dean Hall: "Re: [PHP-DB] Session files never destroyed with PHP4.0.2"
- Previous message: Olivier Delaye: "[PHP-DB] Session files never destroyed with PHP4.0.2"
- Next in thread: John McKown: "Re: [PHP-DB] repeating records"
- Reply: John McKown: "Re: [PHP-DB] repeating records"
- Maybe reply: Cosenza, Mario: "RE: [PHP-DB] repeating records"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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>
- Next message: Dean Hall: "Re: [PHP-DB] Session files never destroyed with PHP4.0.2"
- Previous message: Olivier Delaye: "[PHP-DB] Session files never destroyed with PHP4.0.2"
- Next in thread: John McKown: "Re: [PHP-DB] repeating records"
- Reply: John McKown: "Re: [PHP-DB] repeating records"
- Maybe reply: Cosenza, Mario: "RE: [PHP-DB] repeating records"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

