Hi,@Ioannis Ioannou - Software Engineer
Welcome to Microsoft T-SQL Q&A Forum!
How about this:
SELECT distinct(KCC.ChildID),GuestID,Firstname,LastName,DOB,ReservationID FROM
(select * from KidsClubChild KCC
INNER JOIN KidsClubGuest KCG ON KCC.GuestID = KCG.GuestID
INNER JOIN KidsClubReservation KCR ON KCG.GuestID = KCR.GuestID
)temp
WHERE KCR.ReservationID = 354
As naomi said, you might as well try to modify the design of diagrams. You are using the correct multi-table connection, but there is only a problem in the data connection process.
You did not provide us with some test data, we can only Try to modify the join condition according to your description. If this doesn't work, please provide some data for us to test this against.
Best regards,
Bert Zhou
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our Documentation to enable e-mail notifications if you want to receive the related email notification for this thread.