i have data in following format:
colA colB
2010 10
2010 20
2010 30
1999 99
I need to obtain output as follows using Linq/Lambda expression:
colA colB
2010 10
1999 99
colB could be any non-99 value but the top 2 should always list 99 and any 1 instance of non-99 value.
I am after the values in colA.
TIA
Are you going for something like this?
Which could be combined into an
IEnumerableusing a utility method such as the following extension:In a manner like so: