From the course: Querying Microsoft SQL Server 2019
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Text concatenation - SQL Server Tutorial
From the course: Querying Microsoft SQL Server 2019
Text concatenation
- [Narrator] Text concatenation is the process of joining two text strings together. SQL server has two concatenation functions that we can use that will do just that in our query of results. I'm going to start with these same first and last name fields out of the person dot person table that we used in the last movie. That'll pull the raw data that we can work with out of the data table. Now in order to turn both the first name and the last name columns together in a single column, you can use the concat function. I'll go ahead and add that to line number three. Concat takes at least two arguments and as many as 254, but they're all just these strings that you want to put together end to end. In our case I want to join the values in the first name column to those in the last name column. I'll just type that out as a comma separated list. I'll also give this column a name, I'll call it AS FullName. The results…
Contents
-
-
-
-
-
-
-
(Locked)
Use functions in T-SQL2m 47s
-
(Locked)
String functions3m 24s
-
(Locked)
Text concatenation3m 33s
-
(Locked)
Round with mathematical functions2m 46s
-
(Locked)
Work with date functions4m 53s
-
(Locked)
FORMAT date and times2m 59s
-
(Locked)
Return random records with NEWID2m 2s
-
(Locked)
The IIF logical function3m 9s
-
(Locked)
-
-
-
-
-