editing sql script (orders to order)