Hi, Megan

You will get the prereq list for each distinct schedule date for the class;
I'm assuming your query is returning 3 dates for the class.

Dave

-----Original Message-----
From: megan sherman [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 13, 2001 9:02 AM
To: CF-Talk
Subject: faulty join?


Hi,
I'm trying to display (kayak) class information on a web page. I have 3
tables, one for class description (primary key "classID"), one for class
prerequisites (primary key "prereqID"), and one for class schedule
(primary key "scheduleID"). I have slimmed down the query and the output
below. It only sorta works. I get a single output of the description,
and a single output of the location/date (no repeats), but something
goes wrong with the prereq's. If there is class with three
prerequisites, say #1 #2 and #5, then the output loop for that class
yields #5 #1 #2, #1 #2 #5,  and #1 #5 #2. I only want the list of
prerequisites to show up once. I've tried a bunch of stuff, but I'm
obviously just guessing. Does anybody have a suggestion toward what I'm
doing wrong?
Thanks in advance,
Megan

SELECT class.classID, class.content, class_schedule.scheduleID,
class_schedule.location, class_schedule.date, class_prereq.prereqID,
class_prereq.prereq
 FROM class, class_schedule, class_prereq
 WHERE (pagename = 'classes_sea' and
class.classID=class_schedule.classID and
class_prereq.classID=class.classID)
 ORDER by rank, class_schedule.location, class_schedule.date

<CFOUTPUT QUERY="content" group="classID">
<p>
class:<br />
#content#<br />
<cfoutput group="prereqID">#prereq# <br /></cfoutput>
<cfoutput group="scheduleID">#location#, #date# <br /></cfoutput>
</p>
</CFOUTPUT>


Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to