Skip to content

Instantly share code, notes, and snippets.

@tcartwright
Last active March 21, 2025 19:07
Show Gist options
  • Save tcartwright/20a9ce408e83ccfaca0d31248302524b to your computer and use it in GitHub Desktop.
Save tcartwright/20a9ce408e83ccfaca0d31248302524b to your computer and use it in GitHub Desktop.
SQL SERVER: The various ways to alias a column
-- Examples of the various ways to alias columns. All other methods except for #1 are deprectated or older styles
SELECT
1 AS [one],
2 [two],
3 AS 'three',
4 'four',
5 AS "five",
6 "six",
[seven] = 7,
'eight' = 8,
"nine" = 9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment