• Encode values according to priority, max-aggregate priority, and decode it. Something like this

    select orderID

    ,case max(case Items.status

    when 'rejected' then 1

    when 'accepted' then 2

    when 'awaiting' then 3

    end)

    when 1 then 'reject'

    when 2 then 'accept'

    when 3 then 'pend'

    end as orderStatus

    from Items

    group by orderID