URGENT HELP WITH MY SQL QUERY

Job ID: 31687733

Budget: $10 – $30 USD

i have changed Order status id on Orders table for all orders by mistake.

We have order status stored on different table too orders_history, which stores all order status data.

I need to run SQL query to match order_id columns, find latest order status by orderhistoryid and copy it to orders table
there is around 500k orders on orders table & 1m in orders_history table.

ORDERS table columns tobe used: order_id | order_status_id
ORDERS_HISTORY table columns: order_history_id | order_id | order_status_id

if Orders table order_id = Order history table order_id
copy from highest order_history_id order status to orders table order_status column.