Created
July 29, 2013 10:35
-
-
Save AlexArchive/6103479 to your computer and use it in GitHub Desktop.
Combines a table's FirstName and LastName attributs to form a single aliased Attribute while handling NULL in various ways.
This file contains hidden or 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 empid, firstname + N' ' + lastname AS full_name | |
FROM HR.Employees | |
SELECT | |
empid, | |
--country + N', ' + region + N', ' + city AS location | |
--country + COALESCE(N',' + region, N'') + N',' + city AS location | |
CONCAT(country + N', ', region + N', ', + city ) AS location | |
FROM HR.Employees |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment