|
ИД | Дата | Турнир | Тур | Матч | ЛВQuery: select * from (select msc.id as id, tm_h.name as hosts_name, tm_g.name as guests_name,
mst.goals_h as goals_h, mst.goals_g as goals_g, tm_h.id as hosts,
tm_g.id as guests, DATE_FORMAT(d.date,'%d/%m/%Y') as game_date, d.day as day,
tgs.name as tgs_name, tgs.id as tgs_id, tsc.round, ss.season
from match_schedule msc, match_statistics mst,
tournament_schedule tsc, teams tm_h, teams tm_g, days d,
tournament_stages tst, tournament_groups_stages tgs,
tournament_gr_st_participants tgsp, seasons ss
where msc.hosts = '694' and tm_h.id = '694' and tm_g.id = msc.guests
and tm_h.id != tm_g.id and tsc.day = d.day and tsc.tour_stage = tst.id
and tst.id = tgs.stage and tgsp.gr_st = tgs.id and tgsp.team = '694'
and msc.played and mst.game = msc.id and msc.tour_sch = tsc.id
and d.day < 12142 and tst.season = ss.season
and tgs.season = ss.season and tgsp.season = ss.season
and (tsc.day <= ss.end_day and tsc.day >= ss.start_day
or ss.end_day is null)
and not tgs.hide
group by tsc.id, ss.id
union select msc.id as id, tm_h.name as hosts_name, tm_g.name as guests_name,
mst.goals_h as goals_h, mst.goals_g as goals_g, tm_h.id as hosts,
tm_g.id as guests, DATE_FORMAT(d.date,'%d/%m/%Y') as game_date, d.day as day,
tgs.name as tgs_name, tgs.id as tgs_id, tsc.round, ss.season
from match_schedule msc, match_statistics mst,
tournament_schedule tsc, teams tm_h, teams tm_g, days d,
tournament_stages tst, tournament_groups_stages tgs,
tournament_gr_st_participants tgsp, seasons ss
where msc.guests = '694' and tm_g.id = '694' and tm_h.id = msc.hosts
and tm_h.id != tm_g.id and tsc.day = d.day and tsc.tour_stage = tst.id
and tst.id = tgs.stage and tgsp.gr_st = tgs.id and tgsp.team = '694'
and msc.played and mst.game = msc.id and msc.tour_sch = tsc.id
and d.day < 12142 and tst.season = ss.season
and tgs.season = ss.season and tgsp.season = ss.season
and (tsc.day <= ss.end_day and tsc.day >= ss.start_day
or ss.end_day is null)
and not tgs.hide
group by tsc.id, ss.id
order by day desc limit 0, 39
) as lstgames order by day asc error: Unknown column 'tst.season' in 'where clause' |
|