Imagine the dummy data
id name category score
1 Alex A 11
2 Alex D 4
3 Bill A 81
4 Bill B 34
5 Bill D 2
6 Carl C 5
7 Carl D 10
I would like to apply the action:
if score of A, B, or C > score of D
then 'Review'
else 'Pass'
So the output is:
id name category score conclusion
1 Alex A 11 Review
2 Alex D 4 Review
3 Bill A 81 Review
4 Bill B 34 Review
5 Bill D 2 Review
6 Carl C 5 Pass
7 Carl D 10 Pass
how can I obtain this in PostgreSQL?