0
I need to return only the highest value of one of the lines below, taking into account that I also need to submit the order code.
I tried to rotate via cursor but without success. The cursor would pass the 3 lines, but would need to consider only one of higher value.
How do I fix it? Any help? I’m on the right track?
what criteria do you want to use for "cod_request", the highest or the lowest? Since the other fields are the same, you need to sort in some way. You must return which of the "cod_requested"?
– Ricardo Pontual
There is no criterion, the important thing is to return the higher value of one of the two orders. We can consider it a last request, provided it has the highest value.
– Thiago