November 7, 2006 at 10:31 am
I have a table which contains serveral lists. Each list has multiple records which were generated at different times. There is a date stamp on each record. I need to be able to select the group of records for each list which was generated at the latest date.
Please hlep.
November 7, 2006 at 10:46 am
This should return a list of 'other' by listname and latest date.
create table #myLists
(id int identity, other varchar(20), listName varchar(20), insertDate datetime)
select listName, other, insertDate
from #myLists ml
INNER JOIN
(select listName, max(insertDate) mxdate FROM #myLists) as dl
ON ml.listName = dl.listName and ml.insertDate = dl.mxDate
November 7, 2006 at 1:47 pm
Thanks very much Daryl.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply