Новости игры Газета «Бомбардир» Правила Форум Контакты Регистрация
Онлайн игра "Золотая Бутса"
46  сезон

\"\"/

НАВИГАЦИЯ
Профиль
Дневник
Друзья
Фотографии
Написать письмо
Дневники

skywalk | sql14.10.2007 01:58
select c.TournamentID,c.Day,c.Date,m.MatchID,tm.Approved, concat(t1.Name_rus,', ',c.Tour) as Tournament, if((m.TeamID1='5807' and coalesce(m.OrderTeam1,o.OrderFile) is not null) or (m.TeamID2='5807' and coalesce(m.OrderTeam2,o.OrderFile) is not null),1,null) as OrderFile, concat_ws(', ', t1.Name_rus,z.Name_rus, if(r.Name_rus='',null,r.Name_rus), case r.reglament WHEN 0 THEN concat(c.Tour-r.tour1+1,' тур') WHEN 1 THEN concat('1/',power(2, floor((r.tour2-c.Tour)/r.Games)+1),' финала') WHEN 2 THEN if(r.Tour2-r.Tour1 <= r.Games ,null,concat(round((c.Tour-r.tour1+1)/r.Games),' тур')) Else m.Tour end , if(r.Games=2 and r.ShowTable=0, if(mod (r.tour2-c.Tour,2),'Первый матч','Ответный матч'),null) ) as Tournament, t1.ShortName, tm.TeamID, if(tm.TeamID,concat( concat_ws('','',tm.Name_rus,'') ,if(m.TeamID1='5807',' (д)',' (г)')),' ') as Opponent, if(tm.TeamID,concat(tm.Name_rus,if(m.TeamID1='5807',' (д)',' (г)')),' ') as OpponentName from ut_calendar c <span>join</span> ut_tournaments t on c.TournamentID=t.TournamentID and (t.ZoneID=0 or (select CountryID from ut_teams where TeamID='5807') in (select CountryID from ut_countries c <span>join</span> ut_continents cnt on c.ContinentID=cnt.ContinentID <span>join</span> ut_zones z on cnt.ZoneID=z.ZoneID where z.ZoneID=t.ZoneID)) and t.SeasonID=(select max(SeasonID) from ut_seasons) left outer <span>join</span> ut_reglaments r on r.TournamentID=c.TournamentID and (r.Tour1<=c.Tour and r.Tour2>=c.Tour) left outer <span>join</span> ut_tournament_types t1 on (t1.TypeID=t.TypeID) left outer <span>join</span> ut_orders o on (o.TeamID='5807' and o.TournamentID=c.TournamentID and (o.Tour=c.Tour)) left outer <span>join</span> ut_zones z on z.ZoneID=t.ZoneID left outer <span>join</span> (select if(TeamID2='5807',TeamID1,TeamID2) as TeamID, TeamID1,TeamID2,OrderTeam1,OrderTeam2,TournamentID,Tour,MatchID from ut_matches m1 where (TeamID1='5807' or TeamID2='5807') ) as m on (c.TournamentID=m.TournamentID and c.Tour=m.Tour) left outer <span>join</span> ut_teams tm on (tm.TeamID=m.TeamID) where ('select'='fullschedule' or 'select'='fulltest' or (( 'select'='schedule' or 'select'='select') and c.Date>'1191182400'-1 and c.Date<'1193864400' )) order by c.Date asc, c.TournamentID asc
Комментарии [0] Добавить


Комментарий
 
Rambler's Top100  
Качество ProBanner