Hi
Hope you can help, been racking my brains on this.
How can I pick a field from a group, based on the order of another field in the group? Not sure if that explains it so..
I have a table
RowID (Int, ID)
ProductCode (Varchar)
CreatedDate (DateTime)
Basically, I want the RowID based on the most recent CreatedDate within each ProductCode.
So, I can do this..
SELECT ProductCode, MAX(CreateDate)
FROM Table
GROUP BY ProductCode
That shows me the highest date on each product, but I want to know what the RowID of that record is?
How can it be done??
Please help