I am trying to get next:
I have a table orders. This table has column order_uuid. I have another table status_history which has all the statuses of each order.
I need to get all the order and the max value of all the statuses of each order.
Example:
order1 has statuses 1,2,3
order2 has statuses 4,5,6
it must return order1, 3 and order2 and 6.