Answered by:
First value and Last Value

Question
-
What is First value and last value function in T-SQL ? Can you explain with real time example ?
SQL BI Developer (Starting to learn more about SQL&BI)
Wednesday, July 13, 2016 11:43 PM
Answers
-
What's wrong with Google? There's loads of examples already out there and likely going to be explained better than can be on here
https://msdn.microsoft.com/en-us/library/hh213018.aspx?f=255&MSPPError=-2147217396
Last_Value, at present, is pretty pointless since it always returns the current row's value, use First_Value with descending order to create the equivalent
- Proposed as answer by Naomi N Thursday, July 14, 2016 12:58 AM
- Marked as answer by Sam ZhaMicrosoft contingent staff Saturday, July 23, 2016 3:50 AM
Thursday, July 14, 2016 12:20 AM -
Just because I am a bit partial to this site and I know people write good blogs there, try this one for a very good explanation
For every expert, there is an equal and opposite expert. - Becker's Law
My blog
My TechNet articles- Marked as answer by Sam ZhaMicrosoft contingent staff Saturday, July 23, 2016 3:50 AM
Thursday, July 14, 2016 1:00 AM
All replies
-
What's wrong with Google? There's loads of examples already out there and likely going to be explained better than can be on here
https://msdn.microsoft.com/en-us/library/hh213018.aspx?f=255&MSPPError=-2147217396
Last_Value, at present, is pretty pointless since it always returns the current row's value, use First_Value with descending order to create the equivalent
- Proposed as answer by Naomi N Thursday, July 14, 2016 12:58 AM
- Marked as answer by Sam ZhaMicrosoft contingent staff Saturday, July 23, 2016 3:50 AM
Thursday, July 14, 2016 12:20 AM -
Just because I am a bit partial to this site and I know people write good blogs there, try this one for a very good explanation
For every expert, there is an equal and opposite expert. - Becker's Law
My blog
My TechNet articles- Marked as answer by Sam ZhaMicrosoft contingent staff Saturday, July 23, 2016 3:50 AM
Thursday, July 14, 2016 1:00 AM