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, (DATEDIFF(CURRENT_DATE(), Listing_Created_Date)) AS Day_on_market, 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 M.Agent_ID IN('20071208001554716021000000', '20140506203241854785000000', '20120913230657560882000000', '20071208002015500750000000', '20120109205051712293000000', '20110118212220430771000000', '20140721151939380967000000', '20160330225331682741000000', '20071208001609119108000000', '20100707200222820732000000', '20160503232227149453000000', '20130326171216606049000000', '20140821201614237080000000', '20130730225015986028000000', '20160916232009068047000000') AND ListingStatus = 'Active' AND M.is_mark_for_deletion = 'N' ORDER BY ListPrice asc
MySQL Error: 1054 (Unknown column 'AI.SaleType' in 'field list')
Session halted.