If you are outputting this via cfouput, how about grouping by raceid?

  ----- Original Message -----
  From: Jeff Fongemie
  To: CF-Talk
  Sent: Tuesday, July 27, 2004 1:55 PM
  Subject: sql question

  Hey everyone.

  I'm stumped.

  I need to be able to display a list of bicycle races, and under the race list the riders names and positions. I'd like to have two tables so the admin adding the  data only needs to enter the race name and date once, then adds the riders in a seperate table linked by a raceid.

  Right now I've got two tables, one for the races, one for riders linked by common field raceid.

  The above seems fine, but I'm having trouble querring and displaying results. What I need should look like this:

  RACE NAME, DATE, COUNTRY
  ridername, place, team
  ridername, place team
  ridername, place team

  RACE NAME, DATE, COUNTRY
  ridername, place, team
  ridername, place, team

  and so on.

  Display the race info once, and then the riders under that.

  Do I join at the query? Group at the query? Group at the output?
  This shows me everything:
  SELECT     *
  FROM riders, races
  WHERE riders.raceid=races.raceid

  I wish I could do this:
  SELECT     *
  FROM riders, races
  WHERE riders.raceid=races.raceid
  Group By Raceid

  Any suggestions would be most appraciated.

  Thanks,

  JF
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to