Viewing 4 posts - 16 through 20 (of 20 total)
I should add that, because OrderStatusID is the clustered primary key, which is why I opted to use it for my sort (MAX(OrderStatusID)) and join.
October 27, 2011 at 12:08 am
Can you use the RANK() function? Something like...
SELECT A.Key, A.Date, A.Status, A.Ranking
FROM (SELECT Key, Date, Status
, RANK() OVER(PARTITION BY Key ORDER BY Date DESC) AS Ranking
FROM table) A
WHERE A.Ranking <=...
October 26, 2011 at 11:21 pm
Koen, You had me until script component. Once you got there, it didn't feel any more graceful than doing it inside the stored procedure. Oh, well. Thanks for putting the...
March 18, 2011 at 8:50 am
I confused things a little by typing the result set wrong. I expected:
ABCDEF
ABCABC
DEFDEF
and got:
ABCDEF
ABCABC
ABCDEF
DEFDEF
In other words, (ABC, DEF) got doubled up. But the responses from Steve and Celko gave me...
January 14, 2011 at 10:00 am
Viewing 4 posts - 16 through 20 (of 20 total)