# What will be the result of the following query: select concat first_name last_name as full_name from employees?

If you have a table named employees… SELECT CONCAT(first_name, ' ', last_name) AS full_name FROM employees; …you will get the employees' names in one column. What we did above in CONCAT() is merge three strings.

Bron: [CONCAT() in SQL: Tips and Techniques for Efficient Queries](https://www.stratascratch.com/blog/concat-in-sql-tips-and-techniques-for-efficient-queries/#:~:text=If%20you%20have%20a%20table%20named%20employees%E2%80%A6&text=SELECT%20CONCAT(first_name%2C%20'%20',()%20is%20merge%20three%20strings.)

Onderwerp: [Techniek & internet](https://1001vragen.nl/onderwerp/techniek-en-internet)
Toegevoegd: 2026-01-26
Webpagina: https://1001vragen.nl/vraag/what-will-be-the-result-of-the-following-query-select-concat-first-name-last-name-as-full-name-from-employees

## How do you concatenate first name and last name in SQL?

Basic Syntax of the SQL CONCAT() Function If you have a table named employees… SELECT CONCAT(first_name, ' ', last_name) AS full_name FROM employees; …you will get the employees' names in one column.

Bron: [CONCAT() in SQL: Tips and Techniques for Efficient Queries](https://www.stratascratch.com/blog/concat-in-sql-tips-and-techniques-for-efficient-queries/#:~:text=Basic%20Syntax%20of%20the%20SQL%20CONCAT()%20Function&text=If%20you%20have%20a%20table%20named%20employees%E2%80%A6&text=SELECT%20CONCAT(first_name%2C%20'%20',employees'%20names%20in%20one%20column.)

## What does the SQL function concat() do?

The SQL CONCAT() function combines two or more strings into one. It is commonly used for merging first and last names, formatting values, or dynamically generating messages inside SQL queries. The CONCAT syntax is supported by most relational databases including MySQL, PostgreSQL, and SQL Server.

Bron: [SQL CONCAT() Function: Syntax, Usage, and Examples - Mimo](https://mimo.org/glossary/sql/concat#:~:text=The%20SQL%20CONCAT()%20function,%2C%20PostgreSQL%2C%20and%20SQL%20Server.)

## How to get first name and last name from full name in SQL?

- SELECT SUBSTRING(full_name,1,CHARINDEX(',',full_name)-1) AS LastName,
- LTRIM(SUBSTRING(full_name,CHARINDEX(',',full_name)+1,254)) AS FirstNameStart.
- SUBSTRING(FirstNameStart,1,ISNULL(NULLIF(CHARINDEX(' ',FirstNameStart),0),254)) AS FirstName,

Bron: [Get Last Name, First name and Middle Name from Full Name](https://www.sqlservercentral.com/forums/topic/get-last-name-first-name-and-middle-name-from-full-name)

## Verwante vragen

- [What will the following statement return: select employee_id last_name from employees where salary select min salary from employees group by department_id )?](https://1001vragen.nl/vraag/what-will-the-following-statement-return-select-employee-id-last-name-from-employees-where-salary-select-min-salary-from-employees-group-by-department-id.md)
- [Which of the following must come first in a SQL query?](https://1001vragen.nl/vraag/which-of-the-following-must-come-first-in-a-sql-query.md)
- [What was the purpose of using select first_name last_name salary?](https://1001vragen.nl/vraag/what-was-the-purpose-of-using-select-first-name-last-name-salary.md)
- [What query can be used to view the maximum salary of employees in a specific department in a month-wise format?](https://1001vragen.nl/vraag/what-query-can-be-used-to-view-the-maximum-salary-of-employees-in-a-specific-department-in-a-month-wise-format.md)
- [How do you limit the number of rows returned in a query result to 5?](https://1001vragen.nl/vraag/how-do-you-limit-the-number-of-rows-returned-in-a-query-result-to-5.md)
- [How to concat first three characters in SQL?](https://1001vragen.nl/vraag/how-to-concat-first-three-characters-in-sql.md)
- [How to concat two names in SQL?](https://1001vragen.nl/vraag/how-to-concat-two-names-in-sql.md)
- [How to use concat in select query?](https://1001vragen.nl/vraag/how-to-use-concat-in-select-query.md)
- [Which of the following is used to prevent SQL injection attacks?](https://1001vragen.nl/vraag/which-of-the-following-is-used-to-prevent-sql-injection-attacks.md)
- [Which SQL injection defense method should only be used as a last resort?](https://1001vragen.nl/vraag/which-sql-injection-defense-method-should-only-be-used-as-a-last-resort.md)
