Created
March 6, 2018 09:55
-
-
Save spaghettidba/a363c0984a9c911742235f1b121251d0 to your computer and use it in GitHub Desktop.
MAX of multiple columns
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT MAX(n) | |
FROM ( | |
SELECT 1 AS a, 2 AS b, 3 AS c, 4 AS d, 5 AS e, 6 AS f, 7 AS g, 8 AS h, 9 AS i, 10 AS j | |
) AS sourceData | |
UNPIVOT (n FOR r IN (a,b,c,d,e,f,g,h,i,j)) AS u; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment