Date: 03/15/05 (MySQL Communtiy) Keywords: sql Hi everyone, I just joined, I think I have a simple question but my brain has frozen and is having difficulty remembering my SQL lessons from university a few years back... I have 2 tables - Student and Unit, Student lists all name and contact details, Unit lists all subjects each student is studying. Each ONE student has MANY units and each ONE unit has MANY students. How can I perform a query that lists ALL units being studied by EACH student? as in: Student 12345 Units ABC123, DEF321, HIJ567 Student 45678 Units TUV654, DEF321, MNO321 I've been trying variations of GROUP BY and HAVING, to no avail... Thanks in advance! Carla Source: http://www.livejournal.com/community/mysql/50475.html
|