[thelist] ColdFusion Question

Rudy_Limeback at maritimelife.ca Rudy_Limeback at maritimelife.ca
Mon Sep 25 16:52:41 CDT 2000

> I'm stuck here. Any suggestions at all?

hi minh lee

what's the question?  you gave some background info but didn't say what 
was wrong  ;o)

are you trying to join the tables?  you described two tables

    Classes (ID, TableName, CourseName)

     StudentData (StudentID, LastName, FirstName)

i think you're going to require another table, since each class can have 
many students, and presumably each student can be in one or more classes, 
so i think you need something like

   StudentClass (StudentID, ClassID)

to implement the many-to-many intersection, and then a class list query 
would look like this

 SELECT Classes.CourseName, StudentID, LastName, FirstName
   FROM Classes, StudentClass, StudentData
  WHERE Classes.TableName = '#ClassName#'
    AND Classes.ID = StudentClass.ClassID
    AND   StudentClass.StudentID = StudentData.StudentID


More information about the thelist mailing list