I need some help on writing the correct select statement...
I have 3 tables (1 reservation can have a primary KidsClubGuest and one KidsClubGuest can have multiple KidsClubChild).
1. KidsClubReservation
2. KidsClubGuest
3. KidsClubChild
I am trying to find a suitable select statement which displays all the KidsClubChild rows where ReservationID = 354 for example.
I have tried this which brings 58 records, thats all the children in the table.
SELECT KCC.* --,KCG.GuestID
FROM KidsClubChild KCC
INNER JOIN KidsClubGuest KCG ON KCC.GuestID = KCG.GuestID
Then the moment I try the below, the return result is 1558 and based on the below if I try to use a where clause then its brings the wrong result set...
SELECT KCC.* --,KCG.GuestID
FROM KidsClubChild KCC
INNER JOIN KidsClubGuest KCG ON KCC.GuestID = KCG.GuestID
INNER JOIN KidsClubReservation KCR ON KCG.GuestID = KCR.GuestID
SELECT KCC.* --,KCG.GuestID
FROM KidsClubChild KCC
INNER JOIN KidsClubGuest KCG ON KCC.GuestID = KCG.GuestID
INNER JOIN KidsClubReservation KCR ON KCG.GuestID = KCR.GuestID
WHERE KCR.ReservationID = 354