Just Listed

SQL: SELECT TOP 51 Rental.id AS Rental_id, Rental.CustomerId AS Rental_CustomerId, Rental.RentalTypeId AS Rental_RentalTypeId, Rental.ContentId AS Rental_ContentId, Rental.AddressId AS Rental_AddressId, Rental.SoftwareId AS Rental_SoftwareId, Rental.StaffId AS Rental_StaffId, Rental.ManagerId AS Rental_ManagerId, Rental.Title AS Rental_Title, Rental.Teaser AS Rental_Teaser, Rental.Bedrooms AS Rental_Bedrooms, Rental.Bathrooms AS Rental_Bathrooms, Rental.Sleeps AS Rental_Sleeps, Rental.Code AS Rental_Code, Rental.SoftwareCode AS Rental_SoftwareCode, Rental.UrlTitle AS Rental_UrlTitle, Rental.Priority AS Rental_Priority, Rental.EnabledFlag AS Rental_EnabledFlag, Rental.SoftwareEnabledFlag AS Rental_SoftwareEnabledFlag, Rental.DateCreated AS Rental_DateCreated, Rental.DateUpdated AS Rental_DateUpdated, Rental.DateDisplayed AS Rental_DateDisplayed, Address.id AS Address_id, Address.AddressTypeId AS Address_AddressTypeId, Address.Address1 AS Address_Address1, Address.Address2 AS Address_Address2, Address.City AS Address_City, Address.StateId AS Address_StateId, Address.CountryId AS Address_CountryId, Address.ZipCode AS Address_ZipCode, Address.Latitude AS Address_Latitude, Address.Longitude AS Address_Longitude, Address.DateCreated AS Address_DateCreated, Address.DateUpdated AS Address_DateUpdated, AddressType.id AS AddressType_id, AddressType.AddressType AS AddressType_AddressType, Content.id AS Content_id, Content.LanguageId AS Content_LanguageId, Content.HtmlContent AS Content_HtmlContent, Content.PageTitle AS Content_PageTitle, Content.MetaDesc AS Content_MetaDesc, Content.MetaKeywords AS Content_MetaKeywords, Content.DateCreated AS Content_DateCreated, Content.DateUpdated AS Content_DateUpdated, Customer.id AS Customer_id, Customer.AccountId AS Customer_AccountId, Customer.AddressId AS Customer_AddressId, Customer.Company AS Customer_Company, Customer.LegalName AS Customer_LegalName, Customer.Email AS Customer_Email, Customer.EnabledFlag AS Customer_EnabledFlag, Customer.ApiKey AS Customer_ApiKey, Customer.DateCreated AS Customer_DateCreated, Customer.DateUpdated AS Customer_DateUpdated, Manager.id AS Manager_id, Manager.CustomerId AS Manager_CustomerId, Manager.Title AS Manager_Title, Manager.Code AS Manager_Code, Manager.FeatureValue AS Manager_FeatureValue, Manager.DateCreated AS Manager_DateCreated, Manager.DateUpdated AS Manager_DateUpdated, Manager.Status AS Manager_Status, Manager.Commission AS Manager_Commission, RentalType.id AS RentalType_id, RentalType.RentalType AS RentalType_RentalType, Software.id AS Software_id, Software.CustomerId AS Software_CustomerId, Software.SoftwareTypeId AS Software_SoftwareTypeId, Software.ApiUrl AS Software_ApiUrl, Software.Code AS Software_Code, Software.Username AS Software_Username, Software.Password AS Software_Password, Software.ClientId AS Software_ClientId, Software.ApiKey AS Software_ApiKey, Software.DateCreated AS Software_DateCreated, Software.DateUpdated AS Software_DateUpdated, Software.AutoSyncFlag AS Software_AutoSyncFlag, Software.Title AS Software_Title, Software.ApiSecret AS Software_ApiSecret, Software.ApiToken AS Software_ApiToken, Software.ApiTokenSecret AS Software_ApiTokenSecret, Staff.id AS Staff_id, Staff.CustomerId AS Staff_CustomerId, Staff.StaffTypeId AS Staff_StaffTypeId, Staff.ContactId AS Staff_ContactId, Staff.Password AS Staff_Password, Staff.EnabledFlag AS Staff_EnabledFlag, Staff.DateCreated AS Staff_DateCreated, Staff.DateUpdated AS Staff_DateUpdated, Staff.DateDisplayed AS Staff_DateDisplayed, Staff.AccountAdminFlag AS Staff_AccountAdminFlag, Staff.LinkedInUser AS Staff_LinkedInUser, Staff.PasswordHash AS Staff_PasswordHash, Contact.id AS Contact_id, Contact.Company AS Contact_Company, Contact.FirstName AS Contact_FirstName, Contact.LastName AS Contact_LastName, Contact.Title AS Contact_Title, Contact.Email AS Contact_Email, Contact.DateBirth AS Contact_DateBirth, Contact.DateAnniversary AS Contact_DateAnniversary, Contact.DateCreated AS Contact_DateCreated, Contact.DateUpdated AS Contact_DateUpdated, _Reviews.Rating AS Rental_Rating, _Reviews.ReviewCount AS Rental_ReviewCount, _MediaCounts_Rental.ImageCount AS Rental_ImageCount, _MediaCounts_Rental.VideoCount AS Rental_VideoCount, Rates.MinNight As Rental_MinNightRate, Rates.AvgNight As Rental_AvgNightRate, Rates.MinWeek As Rental_MinWeekRate, Rates.MinMonth As Rental_MinMonthRate, (CASE WHEN Rates.MinNight IS NULL AND Rates.MinWeek IS NULL THEN 9999999 WHEN Rates.MinNight IS NOT NULL THEN Rates.MinNight ELSE Rates.MinWeek / 7 END) AS Rental_MinRateSorted, (SELECT TOP 1 TurnDay FROM TurnDay WHERE TurnDay.RentalId = Rental.id) As Rental_TurnDay, '' As Rental_PromoCode, 0 As Rental_DiscountPer, (SELECT TOP 1 MinNights FROM Restriction WHERE Restriction.RentalId = Rental.id) As Rental_MinNights, _ImgPvt_Rental.[1] AS Rental_ImageUrl_1, (SELECT TOP 1 FeatureValue FROM RentalFeature WHERE RentalId = Rental.id AND FeatureId = 1857) AS Rental_Feature_0, (SELECT TOP 1 Feature FROM Feature WHERE Id = 1857) AS Rental_FeatureName_0, (SELECT TOP 1 FeatureValue FROM RentalFeature WHERE RentalId = Rental.id AND FeatureId = 1867) AS Rental_Feature_1, (SELECT TOP 1 Feature FROM Feature WHERE Id = 1867) AS Rental_FeatureName_1, (SELECT TOP 1 FeatureValue FROM RentalFeature WHERE RentalId = Rental.id AND FeatureId = 1856) AS Rental_Feature_2, (SELECT TOP 1 Feature FROM Feature WHERE Id = 1856) AS Rental_FeatureName_2, (SELECT TOP 1 FeatureValue FROM RentalFeature WHERE RentalId = Rental.id AND FeatureId = 1931) AS Rental_Feature_3, (SELECT TOP 1 Feature FROM Feature WHERE Id = 1931) AS Rental_FeatureName_3, (SELECT TOP 1 FeatureValue FROM RentalFeature WHERE RentalId = Rental.id AND FeatureId = 1871) AS Rental_Feature_4, (SELECT TOP 1 Feature FROM Feature WHERE Id = 1871) AS Rental_FeatureName_4, (SELECT TOP 1 FeatureValue FROM RentalFeature WHERE RentalId = Rental.id AND FeatureId = 1873) AS Rental_Feature_5, (SELECT TOP 1 Feature FROM Feature WHERE Id = 1873) AS Rental_FeatureName_5, (SELECT TOP 1 FeatureValue FROM RentalFeature WHERE RentalId = Rental.id AND FeatureId = 1933) AS Rental_Feature_6, (SELECT TOP 1 Feature FROM Feature WHERE Id = 1933) AS Rental_FeatureName_6, (SELECT TOP 1 FeatureValue FROM RentalFeature WHERE RentalId = Rental.id AND FeatureId = 1937) AS Rental_Feature_7, (SELECT TOP 1 Feature FROM Feature WHERE Id = 1937) AS Rental_FeatureName_7, (SELECT TOP 1 FeatureValue FROM RentalFeature WHERE RentalId = Rental.id AND FeatureId = 1866) AS Rental_Feature_8, (SELECT TOP 1 Feature FROM Feature WHERE Id = 1866) AS Rental_FeatureName_8, (SELECT TOP 1 FeatureValue FROM RentalFeature WHERE RentalId = Rental.id AND FeatureId = 1932) AS Rental_Feature_9, (SELECT TOP 1 Feature FROM Feature WHERE Id = 1932) AS Rental_FeatureName_9 FROM Rental INNER JOIN Address On Rental.AddressId = Address.id INNER JOIN Content On Rental.ContentId = Content.id INNER JOIN Customer On Rental.CustomerId = Customer.id INNER JOIN RentalType On Rental.RentalTypeId = RentalType.id LEFT OUTER JOIN AddressType On Address.AddressTypeId = AddressType.id LEFT OUTER JOIN Manager On Rental.ManagerId = Manager.id LEFT OUTER JOIN Software On Rental.SoftwareId = Software.id LEFT OUTER JOIN Staff On Rental.StaffId = Staff.id LEFT OUTER JOIN Contact On Staff.ContactId = Contact.id LEFT OUTER JOIN (SELECT RentalId, Position, IIF(CHARINDEX('https://imagedelivery.net', MediaUrl) >= 1, MediaUrl, LOWER(CAST(CAST(M.id AS VARCHAR) + ISNULL('-' + CAST(M.MediaUrl AS VARCHAR(200)), '') + '.' + MT.MediaType AS VARCHAR(200)))) AS Url FROM Media M INNER JOIN MediaType MT ON M.MediaTypeId = MT.id INNER JOIN RentalMedia RM ON M.id = RM.MediaId WHERE M.MediaTypeId BETWEEN 1 AND 9 AND M.Position IN (1)) _ImgSrc_Rental PIVOT (MAX(Url) FOR Position IN ([1])) AS _ImgPvt_Rental ON _ImgPvt_Rental.RentalId = Rental.id LEFT OUTER JOIN (SELECT RentalId, CAST(AVG(CAST(Rating AS Decimal(4,1))) AS Decimal(4,1)) AS Rating, COUNT(*) AS ReviewCount FROM Review WHERE EnabledFlag = 1 GROUP BY RentalId) AS _Reviews ON _Reviews.RentalId = Rental.id LEFT OUTER JOIN (SELECT RentalId, SUM(CASE WHEN Media.MediaTypeId IN (1, 2) THEN 1 ELSE 0 END) AS ImageCount, SUM(CASE WHEN Media.MediaTypeId IN (10, 11) THEN 1 ELSE 0 END) AS VideoCount FROM RentalMedia INNER JOIN Media ON RentalMedia.MediaId = Media.id GROUP BY RentalId) AS _MediaCounts_Rental ON _MediaCounts_Rental.RentalId = Rental.id LEFT OUTER JOIN (SELECT RentalId, MIN(CASE WHEN RateTypeId = 1 THEN MinRate END) AS MinNight, CAST(AVG(CASE WHEN RateTypeId = 1 THEN CAST(MinRate AS FLOAT) END) AS INT) AS AvgNight, MIN(CASE WHEN RateTypeId = 2 THEN MinRate END) AS MinWeek, MIN(CASE WHEN RateTypeId = 3 THEN MinRate END) AS MinMonth FROM Rate WHERE PastFlag = 0 GROUP BY RentalId) As Rates On Rates.RentalId = Rental.id LEFT OUTER JOIN (SELECT MIN(RentalFeature.FeatureValue) AS Price, RentalFeature.RentalId FROM RentalFeature INNER JOIN Feature ON RentalFeature.FeatureId = Feature.Id WHERE Feature.Feature = 'Asking Price' GROUP BY RentalFeature.RentalId) AS AskingPrice ON AskingPrice.RentalId = Rental.Id WHERE Rental.id IS NOT NULL AND Rental.CustomerId IN (1000) AND Rental.RentalTypeId IN (4) AND Rental.EnabledFlag = 1 AND Rental.id IN (4974066,5496593,4971291,4971265,5334333,5334332,5334331,5334330,4970894,4970888,5474280,4970496,4970468,5381750,4970062,4970081,4970080,4976449,4970077,4966895,4965860,4965729,4964574,4964181,4964168,4964172,4963629,4963774,4963779,5266944,4963777,4963327,4963349,4963362,4963363,4963345,4963356,4963334,4962927,4962864,4962518,4962137,5550190,5550189,5518093,4961242,4960932,4960926,5491000,4960902,4960935) And (EXISTS(SELECT * FROM RentalFeature WHERE RentalId = Rental.id AND FeatureId = 1933 AND FeatureValue IN ('Active'))) ORDER BY Rental_Code desc

Whew... Lots of properties!
Please, give us a sec.