SELECT packages.id AS PACKAGE_ID, packages.hotel_id AS HOTEL_ID, packages.room_id AS ROOM_ID, annual_calendar.day_date AS DAY_DATE, allotments_new.day_date AS ALLOTMENTS_DAY_DATE, packages.low_min_nights AS PACKAGE_LOW_MIN_NIGHTS, packages.low AS PACKAGE_LOW_RATE, hotels.beta_supplier AS SUPPLIER_ID FROM packages INNER JOIN hotels ON hotels.hotel_id = packages.hotel_id AND hotels.status = 'active' INNER JOIN hotelrooms ON hotelrooms.room_id = packages.room_id AND hotelrooms.status = 'active' LEFT OUTER JOIN calendars_new ON calendars_new.hotel_id = hotels.hotel_id AND calendars_new.day_date <= '2015-11-26' AND calendars_new.day_date >= '2014-11-26' LEFT OUTER JOIN allotments_new ON allotments_new.package_id = packages.id AND allotments_new.day_date <= '2015-11-26' AND allotments_new.day_date >= '2014-11-26' AND calendars_new.day_date = allotments_new.day_date LEFT OUTER JOIN annual_calendar ON annual_calendar.day_date = calendars_new.day_date AND annual_calendar.day_date <= '2015-11-26' AND annual_calendar.day_date >= '2014-11-26' WHERE packages.status = 'active' AND packages.id = 8188 AND packages.hotel_id = 4 ORDER BY day_date
CounterP IDR IDannual_calendar.day_daterateallotments_new.day_date
Counter
Edit
Line:68, Time:0.03 seconds