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

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…

Contents