I have a table with following data:
Id groupId status
1 100 Completed
2 100 Completed
3 100 Pending
4 200 Completed
5 200 Completed
6 300 Pending
7 300 Pending
Needed following query output:
GroupId status
100 Partially_completed
200 Completed
300 Pending
Logic:
If all records for group are in "Pending" status, Output should be pending.
If all records for group are in "Completed" status, Output should be completed
If any one is completed and any is pending, Output should be partially completed.