I tried running a query with an inner join in Sequel Pro to get the most recent records/invoices using this:
SELECT tt.Hotel_Property, tt.Preferred_Hotel_Status
FROM hotel_detail tt
INNER JOIN
    (SELECT Hotel_Property, MAX(STR_TO_DATE (`Invoice_Date`, '%m/%d/%Y')) AS MaxDateTime
    FROM hotel_detail
    GROUP BY Hotel_Property) groupedtt 
ON tt.Hotel_Property = groupedtt.Hotel_Property 
AND tt.Invoice_Date = groupedtt.MaxDateTime 
But it's running the query for a long time and I'm not sure if it'll actually execute (cancelled it after waiting 14 mins). I know it's a lot of data to work through but wondered if anyone had suggestions to make it run faster?
*Ideally I want one record for each hotel property giving the most recent invoice date and the status associated with that max invoice
Thanks!
 
     
    