This is my table: enter image description here in my table i should use
SELECT
Title+' '+FirstName+' '+MiddleName+' '+LastName as FullName
from employees
Where BusinessEntityID IN (1,2,4)
But as a result i get only the middle row because that is the only one that does not contain NULL value.
The concat() works fine but i was wondering if there is a solution also with coalesce function for this problem.
Can you please help?
On SQL Server 2017 or later, the
CONCAT_WSfunction provides a nice way of doing this:CONCAT_WS()will ignore null parameters.