I have table in following structure…
ReturnID SumbitID Status
1 1 1
1 NULL 2
2 2 3
3 3 1
3 3 1
I want this output…..
RetunrID TotalAttempt Success
1 2 1
2 1 0
3 2 2
Count Of ReturnID is TotalAttempt, when ReturnID = sumbitID and status =1 Then it count as success…
Thanks in Advance!
Something like this