From the course: Querying Microsoft SQL Server 2022
Unlock the full course today
Join today to access over 24,200 courses taught by industry experts.
Text concatenation - SQL Server Tutorial
From the course: Querying Microsoft SQL Server 2022
Text concatenation
- [Instructor] Text Concatenation is the process of joining two text strings together. SQL Server has two concatenation functions that we can use to do that in our query results. I'm going to start with the same first and last name data that's coming out of the person table that we used in the prior movie. I'll execute the query so we can see the results below. Now, in order to return both the first and the last names together in a single column, you can use the concat function. I'll add one onto line number three. Concat takes at least two arguments and as many as 254 but they're all just the 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 the values in the last name column. I'll name this new column in our query as full name. The results return exactly what I've asked for, all of the characters from the first name joined immediately to all of the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
Use functions in T-SQL3m 10s
-
(Locked)
String functions3m 44s
-
(Locked)
Text concatenation3m 40s
-
(Locked)
Round with mathematical functions3m 13s
-
(Locked)
Find the GREATEST or LEAST value5m 5s
-
(Locked)
Work with date functions5m 56s
-
(Locked)
FORMAT date and times3m 36s
-
(Locked)
Group dates into buckets6m 10s
-
(Locked)
Return random records with NEWID2m 22s
-
(Locked)
Create a series of values5m 13s
-
(Locked)
The IIF logical function3m 39s
-
(Locked)
Write a CASE statement4m 34s
-
(Locked)
Challenge: Use functions in a SQL query49s
-
(Locked)
Solution: Use functions in a SQL query13m 55s
-
(Locked)
Solution: Use functions in a query4m 22s
-
-
-
-
-
-