SELECT
ROW_NUMBER() OVER ( PARTITION BY Event.EventKey ORDER BY Tracker.TrackerKey ) AS RowNumber,
(Event.EventAmount - Tracker.TrackerAmount) as Amount
EventKey RowNumber Amount
2 1 10
2 2 0
2 3 0
2 4 0
I want Out out like below table means I want to display Amount only if the RowNumber is Max of a event key
EventKey RowNumber Amount
2 1 10
2 2 0
2 3 0
2 4 0 THanks in Advance
Go to the complete details ...