SELECT MAX(vx) FROM MyTable AS a UNPIVOT (vx FOR Value IN (Col1, Col2, Col3, Col4)) AS up
SELECT MAX(A.MyValue) FROM ( SELECT Col1 AS MyValue FROM TableName UNION ALL SELECT Col2 AS MyValue FROM TableName UNION ALL SELECT Col3 AS MyValue FROM TableName UNION ALL SELECT Col4 AS MyValue FROM TableName ) AS A
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)