I had someone ask me this question today about a query where he wanted to get a max value along with the ID and Date of the record. However, the varying Date values were causing “duplicates” (as you would expect). He only wanted the first instance he came across. In SQL 2000 I would have written a subquery to do this most likely, but SQL 2005 has a nice RANK T-SQL function you can use instead:
select *
into #temp
from
(
select 1000 ID, -2 SomeValue, dateadd(mm,...
Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.