All pastes #2483 Raw Edit

IanMc

public text v1 · immutable
#2483 ·published 2004-11-30 15:53 UTC
rendered paste body
Hello guys on irc / mysql here's sorta what i'm trying to do,, here are the 

tables & columns =

events
      .EventId
      .VenueId
      .EventDate
      .EventAgeRangeFemaleFrom
      .EventAgeRangeFemaleTo
      .EventAgeRangeMaleFrom
      .EventAgeRangeMaleTo
      .EventStatus
      .EventNotes

Venues
      .VenueId
      .VenueCapacity
      .VenueName
      .VenueTown

bookings
        .BookingId
        .CustomerId
        .EventId

customers
         .CustomerId
         .CustomerGender


These aren't all the columns in the tables but i think they are all i need for the query
that i'd like to do. The reason i'm asking for help is because i think i need to do
a nested join and i've never done one before.

The query would show details for a particular event like:

date, venuename, venuetown, venuenotes then (and here's where it gets a bit complicated)
it would show... Girls agerange (like 25-35) and whether there are places available,
then the same for boys agerange and whether there are places available.
Places available = venues.VenueCapacity divided by 2 for boys, same for girls.

I am writing the app in ASP using a MySQL database