Have following table
PkId ProfileId Status Amount
1 234 0 10
2 235 1 100
3 236 0 50
4 236 1 80
5 237 0 70
For row number 3 and 4 Profile Id is same but I want in resultset it should consider row having value 0 so whereever we have rows where Profile Id is same it should pick row where status =0 And for rest of the rows it should pick as it is.
Expected Result Set:
PkId ProfileId Status Amount
1 234 0 10
2 235 1 100
3 236 0 50
5 237 0 70
In expected result set row number 4 has to be omitted because :
- 236 Id at 4 is already there row number 3
- Value of Status is 1 in row number 4.