Could not select GET_REC_NUM: Unknown column 'srvs.er' in 'field list' SQL USED: SELECT DISTINCT acc.ID AS rec_id, acc.remote_id AS remote_id, acc.Featured AS exclusive, #FLEX0 '' AS flex_bkg_terms, ## `srvs`.`er` AS `er`, `srvs`.`sr` AS `sr`, `srvs`.`pm` AS `pm`, `srvs`.`ner` AS `ner`, `srvs`.`ag` AS `ag`, `srvs`.`wc` AS `wc`, ## acc.new_listing AS is_new, acc.ShowOnSite AS show_on_site, acc.IsPrivate AS is_private, #BRK00 #JOIN00 IF(ofrz.ID IS NULL OR ofrz.ID = 0, 0, 1) as has_offer, IF(lstmnz.ID IS NULL OR lstmnz.ID = 0, 0, 1) as has_lastminute, #CONT00 acc.InfoText AS license_info, acc.AccommType AS acc_typ_code, acc.prop_location AS location_id, acc.AccommName_EN AS acc_name, acc.first_img AS img_filename, acc.Alias AS alias, acc.DescText_Short_EN AS short_desc, acc.BedNum AS num_bed, acc.BathNum AS num_bath, acc.SleepNum AS num_sleep, acc.rate_cur AS rate_cur, acc.rate_lo AS rate_lo, acc.rate_hi AS rate_hi, acc.rate_ny_cur AS rate_ny_cur, acc.rate_ny_lo AS rate_ny_lo, acc.rate_ny_hi AS rate_ny_hi, # acc.ls_rate_lo AS ls_rate_lo, acc.ls_rate_hi AS ls_rate_hi, acc.ls_rate_lo_ny AS ls_rate_lo_ny, acc.ls_rate_hi_ny AS ls_rate_hi_ny, # prop_typ.alias AS prop_typ, loc_0.loc_name AS prop_loc_0, loc_0.alias AS prop_loc_0_alias, loc_0.parent_id AS prop_loc_0_parent, loc_1.loc_name AS prop_loc_1, loc_1.alias AS prop_loc_1_alias, loc_1.id AS prop_loc_1_parent, loc_2.loc_name AS prop_loc_2, loc_2.alias AS prop_loc_2_alias, #BRK01 #JOIN01 # # OFFERS 0 IF(ofrz.offer_count IS NULL, 0, ofrz.offer_count) as offer_count, IF(ofrz.offers IS NULL,'',ofrz.offers) as offers, #JOIN03 # # LSTMINZ 0 IF(lstmnz.lastminute_count IS NULL, 0, lstmnz.lastminute_count) as lastminute_count, IF(lstmnz.lastminute IS NULL,'',lstmnz.lastminute) as lastminute, `rtz`.`created` AS `rts_upd` FROM sbcomdb.Accommodation AS acc LEFT JOIN ( SELECT `rts_skma`.`assoc_id` AS `AssocID`, DATE_FORMAT(`rts_skma`.`created`,'%Y-%m-%d') AS `created` FROM `sbctrldb`.`rts_schema` AS `rts_skma` WHERE `rts_skma`.`deleted` = 0 AND `rts_skma`.`year` >= '2024' GROUP BY `rts_skma`.`assoc_id` ORDER BY `rts_skma`.`created` DESC ) AS `rtz` ON `rtz`.`AssocID` = acc.ID LEFT JOIN sbcomdb.Resorts AS rsrt ON (rsrt.ID = acc.ResortID) INNER JOIN sbcomdb.taxonomy AS prop_typ ON (prop_typ.tax_typ='prop_typ' AND prop_typ.id=acc.prop_typ) INNER JOIN sbcomdb.prop_lox AS loc_0 ON (loc_0.id = acc.prop_location) INNER JOIN sbcomdb.prop_lox AS loc_1 ON (loc_1.id = loc_0.parent_id) LEFT JOIN sbcomdb.prop_lox AS loc_2 ON (loc_2.id = loc_1.parent_id) LEFT JOIN ( SELECT `rts_dsc_skma`.`id` AS `ID`, `rts_dsc_skma`.`assoc_id` AS `AssocID`, `rts_dsc_skma`.`discount` AS `Discount`, GROUP_CONCAT(DATE_FORMAT(`rts_dsc_skma`.`date_bof`,'%Y-%m-%d'),':', DATE_FORMAT(`rts_dsc_skma`.`date_eof`,'%Y-%m-%d'),':',CAST(`rts_dsc_skma`.`discount` AS CHAR) ORDER BY `rts_dsc_skma`.`id` ASC SEPARATOR '#') AS `offers`, COUNT(DISTINCT `rts_dsc_skma`.`id`) AS `offer_count` FROM `sbctrldb`.`rts_discount_schema` AS `rts_dsc_skma` WHERE `rts_dsc_skma`.`deleted` = 0 AND `rts_dsc_skma`.`offer_exp` >= '2024-05-25' ##exp0 #GRPBY-2 GROUP BY `rts_dsc_skma`.`assoc_id` ) AS ofrz ON ofrz.AssocID = acc.ID LEFT JOIN #LSTMINZ 0 ( SELECT ID, AssocID, Discount, #GROUP_CONCAT(DATE_FORMAT(av_lastminute.ArrDate,'%M'),'-', DATE_FORMAT(av_lastminute.DepDate,'%M'),'-',CAST(av_lastminute.Discount AS CHAR) ORDER BY av_lastminute.ID ASC SEPARATOR '#') AS lastminute, GROUP_CONCAT(DATE_FORMAT(av_lastminute.ArrDate,'%Y-%m-%d'),':', DATE_FORMAT(av_lastminute.DepDate,'%Y-%m-%d'),':',CAST(av_lastminute.Discount AS CHAR) ORDER BY av_lastminute.ID ASC SEPARATOR '#') AS lastminute, COUNT(DISTINCT av_lastminute.ID) AS lastminute_count FROM sbcomdb.av_lastminute AS av_lastminute #GRPBY-3 GROUP BY av_lastminute.AssocID ) AS lstmnz ON lstmnz.AssocID = acc.ID WHERE #0 acc.Deleted=0 AND acc.Archived=0 AND acc.ShowOnSite = 1 AND acc.IsPrivate = 0 AND acc.ResortID = 14 #GRPBY-4 GROUP BY acc.ID ORDER BY #0 rec_id=0 DESC, acc.OrdNum_InParent ASC #0 \n\n