Suppose I have table in SQL Server 2008 called Models with the following columns:
ID (int, primary key)
ModelName (varchar(30), not null)
ValidFromDate (datetime, not null)
So I have two different rows for ModelName='A' and five different for ModelName='B' etc. The question is: how do I create a query that would return the latest version of all the models? So it would return a data set with a single row with all columns of the latest revision of model A, a single row with all columns of the latest revision of model B etc. for C, D, E, ...