select
travel0_.travelid
as
col_0_0_,
prices1_.priceid as col_1_0_,
travelagen2_.travelagencyid as col_2_0_,
prices1_.name as col_3_0_,
travelagen2_.name as col_4_0_
from travel travel0_ , price prices1_ , travelagency travelagen2_
where travel0_.travelagencyid = travelagen2_.travelagencyid
and travel0_.traveltypeid <= 2
and travel0_.stat = 1
and to_days(travel0_.startdate) >= to_days( ' 2006-7-1 ' )
and to_days(travel0_.enddate) <= to_days( ' 2006-12-11 ' )
and travel0_.travelid = prices1_.travelid
order by travel0_.lastdate Desc limit 40
prices1_.priceid as col_1_0_,
travelagen2_.travelagencyid as col_2_0_,
prices1_.name as col_3_0_,
travelagen2_.name as col_4_0_
from travel travel0_ , price prices1_ , travelagency travelagen2_
where travel0_.travelagencyid = travelagen2_.travelagencyid
and travel0_.traveltypeid <= 2
and travel0_.stat = 1
and to_days(travel0_.startdate) >= to_days( ' 2006-7-1 ' )
and to_days(travel0_.enddate) <= to_days( ' 2006-12-11 ' )
and travel0_.travelid = prices1_.travelid
order by travel0_.lastdate Desc limit 40