I have a table that holds listing information for housing properties. A property may be in the table multiple times, once for every time it was listed. Here are the relevant columns:
ListingID <- primary key
PropertyID
ListingEndDateTime
I am trying to develop a query to update the EndDateTime for the most recent listing for every property in the table. The query will set the EndDateTime to the same value for every property.
I’ve tried a few approaches have been so far unsuccessful. How do I write such a query?
the following assumes ListingID is an auto_incrementing primary key: