Sample Header Ad - 728x90

MySQL Tennis Ladder View Creation Question

1 vote
1 answer
41 views
I am creating a Tennis Ladder VIEW using MySQL and wish to do the following: - Properly create a view that includes: **All player's names** - These player names will come from the table: **User** - using the field: **name** Here is a very simple structure of the database Tennis Ladder ERD ...and here is the view query I have so far (query generated from HeidiSQL):
select lm.id AS id,
l.ladderName AS ladderName,
l.ladderType AS ladderType,
l.manager_id AS manager_id,
lm.match_round AS match_round,
lm.match_court_scheduled AS match_court_scheduled,
lm.match_datetime_scheduled AS match_datetime_scheduled,
lm.match_date_completed AS match_date_completed,
lm.match_winner AS match_winner,
lm.team1_user1_id AS team1_user1_id,
lm.team2_user1_id AS team2_user1_id 

from (((ladder_matches lm 
left join ladder l on((lm.ladder_id = l.id))) 
left join ladder_users lu on((lm.team1_user1_id = lu.id))) 
left join users u on((lu.user_id = u.id))) 
order by lm.id
Asked by Reno Kendo (21 rep)
Dec 30, 2023, 10:58 PM
Last activity: Dec 31, 2023, 05:57 AM