Quantcast
Viewing all articles
Browse latest Browse all 75

T-SQL get record from the last value of a column

Hi, sample table TID HistoryID Action Date desc === ========= ====== ========= ==== 1 1 A 1/11/2013 abc 1 2 B 2/11/2013 xyz 2 1 A 2/11/2013 abc 2 2 C 3/11/2013 xyz 3 1 A 4/11/2013 abc 3 2 B 5/11/2013 xyz I want to find all the rows for a particular TID where the Action="B" is the last row For example, output should be: 1 1 A 1/11/2013 abc 1 2 B 2/11/2013 xyz 3 1 A 4/11/2013 abc 3 2 B 5/11/2013 xyz How can that be done? Regards, Mandar

Viewing all articles
Browse latest Browse all 75

Trending Articles