sark9012
sark9012

Reputation: 5737

Trying to make a query that takes two tables into account

I am looking for some guidance.

I am trying to select the following

From tbl_leaguetables i want to select user, team, league

league is connected to tbl_leagues

ie if league = 15, in tbl_leagues, the id will be 15.

in that table i then want to get game, type, name

but only where the format = "yes"

How can this be done? I really dont know where to start!!!

Upvotes: 0

Views: 41

Answers (1)

D'Arcy Rittich
D'Arcy Rittich

Reputation: 171421

select lt.user, lt.team, lt.league, 
    l.game, l.type, l.name
from tbl_leaguetables lt
inner join tbl_leagues l on lt.league = l.id
where l.format = 'yes'

Upvotes: 3

Related Questions