I am Using SQL Server 2014
I have a stored procedure that has 6 parameters.
I need to find the Greatest Order Value and Return the OrderID.
I can select the Max Order Value but I need the OrderID of the Highest Order Value
SELECT MAX(v) FROM (VALUES (@OrderValue1), (@OrderValue2), (@OrderValue3)) AS value(v)