MySQL column can't be found -


hi query giving me following error:

unknown column 'm.home_team_id' in 'on clause'

select distinct ( `m`.`match_id`),  `m`.`competition_id`,  `m`.`date`,  `h`.`team_name` "hometeam", `h`.`team_id` "hometeamid",  `a`.`team_name` "awayteam", `a`.`team_id` "awayteamid",  `o`.`for`, `o`.`against`  `single` bs, `matches` m, `teams` t, `outcomes` o  join `teams` `h` on `m`.`home_team_id`=`h`.`team_id`  join `teams` `a` on `m`.`away_team_id`=`a`.`team_id`  `bs`.`match_id`=`m`.`match_id`  , `m`.`score_id`=`o`.`outcome_id`  , `actual_return` not null`enter code here` 

m alias of table named matches has columns home_team_id , away_team_id can't figure why column can't found?

alan.

select       distinct (`m`.`match_id`),        `m`.`competition_id`,        `m`.`date`,         `h`.`team_name` "hometeam",       `h`.`team_id` "hometeamid",         `a`.`team_name` "awayteam",       `a`.`team_id` "awayteamid",         `o`.`for`,        `o`.`against`   `single` bs        join `matches` m on bs.match_id = m.match_id       join `outcomes` o m.score_id = o.outcome_id        join `teams` t   --<--- don't know join `teams` here                            --- don't need in query @         join `teams` `h` on `m`.`home_team_id`=`h`.`team_id`        join `teams` `a` on `m`.`away_team_id`=`a`.`team_id`    `actual_return` not null  

Comments

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -