sql max of two values

Solutions on MaxInterview for sql max of two values by the best coders in the world

showing results for - "sql max of two values"
Jania
14 Jun 2018
1-- For SQL Server >= 2008
2SELECT [Other Fields],
3  (SELECT Max(v) 
4   FROM (VALUES (date1), (date2), (date3),...) AS value(v)) as [MaxDate]
5FROM [YourTableName]
6
7/* Note (from comments): From value(v), "value" is the alias for the 
8 * virtual table and "v" is the name of the virtual column of the date values.
9 */
queries leading to this page
mssql max between two valuesselect 2 max values sqlsql select two max valuesmax of two dates in sqlselect max 2 values sqlsql select max 3 recordsmax between two values sqlget max of 2 columns in sqlselect max value from two value in sqll servertsql max of two valuessql max of two columnssql max two columnsmssql take the max of two valueshow to select multiple max value in sqlsql max function two valuesfind max of two columns sqlsql max of two valuesmssql max between 2 valuesmax of two columns sqlsql max two valuessql highest of two valuessql max of 2 numberssql max between two valuesmax of two values mssqlhow to get 2 max value in sqlget max of two dates in sqlsql server max of two valuescan max have multiple values sqlget max value from multiple columns in sqlget the max value from two columns in sql2 max values sqlhow to get max value out of three value using where conditon in sqlselect distinct column by max value in other columnget max from 2 values from variable in sqlselect max between two values sqlsqlserver max value from twosql max for 2 valuessql get the max value of 2 equal columnsselect max of two values sql serveruse of multiple max 28 29 in sqlsql max 2 valuesmax of two int sql serversql function to find max of two datesfind max two datetime values sqlmax of two levels in sqlmax function multiple value sqlsql maximum of two valuesmax of two columns in sqlmssql max of two valuesmax in sql for two datessql get maximum of two numbersselect max 28v 29 from 28valuessql multiple field get only the biggestsql max of two values