December 3, 2007 at 8:28 am
Hi experts,
Several rows may match my WHERE clause but I only want the one with the maximum created date, MAX(CreatedDate). How would I change this;
SELECT RememberValue
FROM dbo.Remember
WHERE DBName = @DBName
AND SProcSource = @SProcSource
AND SProcVersion = @SProcVersion
AND RememberKey=@RememberKey
Thank you.
December 3, 2007 at 8:31 am
SELECT TOP (1) RememberValue
FROM dbo.Remember
WHERE DBName = @DBName
AND SProcSource = @SProcSource
AND SProcVersion = @SProcVersion
AND RememberKey=@RememberKey
ORDER BY CreatedDate DESC
Regards,
Andras
December 3, 2007 at 9:30 am
Thank you Andras. This is perfect.
Warm regards,
Hope
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply