Database error: Invalid SQL: SELECT M.MLS_NUM, ListingKey, mls_is_pic_url_supported, M.ListPrice, M.PropertyType, M.SubType, M.Beds,M.Baths,M.Main_Photo, M.BathsFull, M.BathsHalf, M.SQFT, M.MLSP_ID, CONCAT(M.MLS_NUM,'-',M.MLSP_ID) As ListingID_MLS, M.YearBuilt, Subdivision, M.Description, TotalPhotos, Parking,M.Is_OpenHouse,M.Is_ShortSale,(DATEDIFF(CURRENT_DATE(), Listing_Created_Date)) AS DOM, A.StreetNumber, A.StreetName, A.StreetDirPrefix, A.StreetDirSuffix, A.CityName, A.State, ZipCode, DisplayAddress, O.Office_Name, AI.SaleType, AI.LotSize,AI.Sold_Price, A.StreetDirection, StreetSuffix, UnitNo, M.Parking, M.YearBuilt, A.Latitude, A.Longitude, AI.StatusChangeDate, AI.LastChangeType, (SELECT CONCAT(OH_Date,',',OH_Begins,',',OH_Close) FROM listing_open_house LMOH WHERE M.MLS_NUM = LMOH.MLS_NUM AND M.MLSP_ID = LMOH.MLSP_ID AND LMOH.OH_Date >= CURRENT_DATE() ORDER BY LMOH.OH_Date ASC LIMIT 1) AS open_house_data FROM listing_master AS M LEFT JOIN listing_address AS A ON M.MLS_NUM = A.MLS_NUM AND M.MLSP_ID = A.MLSP_ID LEFT JOIN listing_office AS O ON M.OfficeID = O.Office_ID AND M.MLSP_ID = O.Office_MLSP_ID LEFT JOIN mls_master AS MM ON M.MLSP_ID = MM.MLSP_ID LEFT JOIN listing_additional_info AS AI ON M.MLS_NUM = AI.MLS_NUM AND M.MLSP_ID = AI.MLSP_ID WHERE 1 AND FIND_IN_SET(PropertyType, 'landlots,residential') AND st_contains(GeomFromText('POLYGON((33.52376793176964 -112.06064242869616,33.52373215509408 -112.05623287707567,33.52012757917445 -112.05623287707567,33.52010074553979 -112.0606316998601,33.52376793176964 -112.06064242869616))'), point(Latitude, Longitude)) AND ListingStatus = 'Active' AND M.is_mark_for_deletion = 'N' ORDER BY ListPrice asc LIMIT 0, 1000
MySQL Error: 1054 (Unknown column 'AI.SaleType' in 'field list')
Session halted.