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 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy