Unique retrieval from timestamp
Hi all,
I am sure this has been covered before but I couldn't find anything that was either applicable to me or I could actually understand, so I apologise for duplication.
I am creating a view of a table in SQL Server 2005. The table will keep a version history of data. There is an ID column of type uniqueidentifier that I set with NEWID() and a timestamp column among others.
When the information is updated on the front end, I will insert a new row using the same ID value, but obviously it will have a more recent timestamp.
Basically, I want my view to display all fields: ID, col1, col2, etc. where ID is unique and pulled from the row with the latest timestamp for that ID.
Can anyone please help me out on this?
Thanks,
Ben