/* tematikus_60_ */ SELECT t.ajanlat_id, t.prior, t.ajanlat_cim, t.ajanlat_alcim, t.ajanlat_szallasnev, t.hajo_id, t.hajotarsasag_id, t.tui_kategoria, t.tui_marka, t.ajanlat_leiras, t.ajanlat_lastupdate, t.orszag_id,t.orszag_id, t.regio_id, t.siregio_id, t.varos_id, t.iroda_id, t.utazasmod_id, t.prtipus_id, t.ellatas_id, t.idopontid, t.galeria_id, t.ellatas_nev, t.szallaskat_nev, t.utazasmod_nev, a.regi_ar, a.akcio_szazalek, a.ardecimal, a.arak_osszesitett, a.eurosar, a.megjegyzes, IF (a.eurosar = 1, ROUND(IF ((SELECT euroarfolyam FROM irodak WHERE iroda_id = t.iroda_id) > 0, (SELECT euroarfolyam FROM irodak WHERE iroda_id = t.iroda_id), 310.00) * a.ardecimal), a.ardecimal) AS euro_forint_iroda, ido.idopont_id, IF(ido.idopont_szezonalis = 1 AND ido.idopont_datum1 <= '2019-08-20', '2019-08-21', ido.idopont_datum1) AS idopont_datum1, ido.idopont_datum2, ido.idopont_ellatas, ido.idopont_idotartam, ido.idopont_idotartam_nap, ido.idopont_szezonalis, ido.idopont_elofoglalas, ido.idopont_akcios, ido.idopont_tipus, ( CASE t.iroda_id WHEN '60' THEN 1 ELSE 2 END ) AS deforderfield FROM (SELECT a.ajanlat_id, a.prior, a.ajanlat_cim, a.ajanlat_alcim, a.ajanlat_szallasnev, h.hajo_id, h.hajotarsasag_id, a.tui_kategoria, a.tui_marka, a.ajanlat_leiras, a.ajanlat_lastupdate, b.orszag_id, b.regio_id, b.siregio_id, b.varos_id, b.iroda_id, b.utazasmod_id, b.prtipus_id, b.ellatas_id, (SELECT x.idopont_id FROM idopont x, arak y WHERE x.idopont_status = 1 AND ( (x.idopont_szezonalis = 1 AND x.idopont_datum2 >= '2019-08-20') OR (x.idopont_szezonalis = 0 AND x.idopont_datum1 >= '2019-08-20' AND x.idopont_datum1 <= '2020-09-20') ) AND ( (x.idopont_arlejar > '0000-00-00' AND x.idopont_arlejar >= '2019-08-21') OR (x.idopont_arlejar = '0000-00-00') ) AND x.ajanlat_id = a.ajanlat_id AND x.idopont_id = y.idopont_id GROUP BY x.idopont_id ORDER BY x.idopont_datum1 ASC, y.ardecimal ASC LIMIT 0, 1 ) AS idopontid, a.galeria_id, l.ellatas_nev, m.szallaskat_nev, n.utazasmod_nev, c.orszag_nev FROM ajanlat a LEFT JOIN ajanlat_korutazas ku ON (a.ajanlat_id = ku.ajanlat_id), arajanlat b LEFT JOIN orszag c ON (b.orszag_id = c.orszag_id) LEFT JOIN hajo h ON (b.hajo_id = h.hajo_id), irodak o, ellatas l, szallaskat m, utazasmod n WHERE a.ajanlat_id = b.ajanlat_id AND b.iroda_id = o.iroda_id AND b.ellatas_id = l.ellatas_id AND b.szallaskat_id = m.szallaskat_id AND b.utazasmod_id = n.utazasmod_id AND a.ajanlat_status = 1 AND (a.ajanlat_megosztas = 1 OR b.iroda_id = 60) AND (b.orszag_id IN(108) OR ku.orszag_id IN(108))AND ((b.utjellemzo_id LIKE '%/14/%')) AND (b.iroda_id IN(252,236,111,343,9,81,430,31,17,45,173,484,486,516,230,528,83,48,452,53,224,205,260,110,141,511,24,322,479,19,200)) GROUP BY a.ajanlat_id ) as t LEFT JOIN arak as a ON (a.idopont_id = t.idopontid) LEFT JOIN idopont as ido ON (ido.idopont_id = t.idopontid) WHERE a.ardecimal IS NOT NULL ORDER BY deforderfield ASC, idopont_datum1 ASC, IF (a.eurosar = 1, euro_forint_iroda, a.ardecimal) ASC LIMIT 0‚ą®derby=7, 20 / Undeclared variable: 0