Database error: Invalid SQL: SELECT t.idx, t.flag, t.icon, t.banner_summer_big, t.style, t.iso2, t.cases, t.is_island, t.name_ru, t.name, t.country_name, t.name_en, t.country_name_en, t.title, t.title_en, t.url, t.url_en, t.country_url, t.country_url_en, t.pageurl, t.pageurl_en, t.recommended, SUM(t.cnt) AS qty, MIN(NULLIF(t.mpr, 0)) AS minprice, MAX(NULLIF(t.maxpr, 0)) AS maxprice, ISNULL(MIN(NULLIF(t.mpr, 0))) AS isn FROM ( (SELECT trw_countries.id AS idx, trw_countries.flag, trw_countries.icon, trw_countries.banner_summer_big, trw_countries.style, trw_countries.iso2, trw_countries.cases, trw_countries.is_island, trw_countries.name_ru, trw_countries.name_ru AS name, trw_countries.name_ru AS country_name, trw_countries.name_en, trw_countries.name_en AS country_name_en, trw_countries.title, trw_countries.title_en, trw_countries.url, trw_countries.url_en, trw_countries.url AS country_url, trw_countries.url_en AS country_url_en, trw_countries.pageurl, trw_countries.pageurl_en, trw_countries.on_the_top_to, trw_countries.order_to, trw_countries.recommended, COUNT(DISTINCT trt_tours.hotel_id) AS cnt, ROUND(MIN(trt_tours.price1*28.8700+trt_tours.price2*1.0000+trt_tours.price3*34.6500)/1.0000) AS mpr, 0 AS maxpr FROM trw_countries, trt_tours LEFT JOIN trt_tours_dates ON trt_tours.id = trt_tours_dates.tour_id WHERE trw_countries.id=trt_tours.country_id AND trt_tours.active=1 GROUP BY idx ORDER BY mpr ASC) UNION (SELECT trw_countries.id AS idx, trw_countries.flag, trw_countries.icon, trw_countries.banner_summer_big, trw_countries.style, trw_countries.iso2, trw_countries.cases, trw_countries.is_island, trw_countries.name_ru, trw_countries.name_ru AS name, trw_countries.name_ru AS country_name, trw_countries.name_en, trw_countries.name_en AS country_name_en, trw_countries.title, trw_countries.title_en, trw_countries.url, trw_countries.url_en, trw_countries.url AS country_url, trw_countries.url_en AS country_url_en, trw_countries.pageurl, trw_countries.pageurl_en, trw_countries.on_the_top_to, trw_countries.order_to, trw_countries.recommended, COUNT(DISTINCT trt_progtours.id) AS cnt, ROUND(MIN(trt_progtours.price1*28.8700+trt_progtours.price2*1.0000+trt_progtours.price3*34.6500)/1.0000) AS mpr, 0 AS maxpr FROM trw_countries, trt_progtours LEFT JOIN trt_progtours_dates ON trt_progtours.id=trt_progtours_dates.tour_id, trt_progtours_locations WHERE trw_countries.id=trt_progtours_locations.country_id AND trt_progtours.id=trt_progtours_locations.tour_id AND trt_progtours.active = 1 GROUP BY idx ORDER BY mpr ASC) ORDER BY mpr ASC ) AS t GROUP BY idx ORDER BY isn ASC, minprice ASC, on_the_top_to DESC, name_ru ASC
MySQL Error: 2006 (MySQL server has gone away)
Session halted.