I have a SQL statement that concatenates First Name and Last Name of the person. I use the following SQL statement.
ISNULL(FullName.FirstName, '') + ' ' + ISNULL(FullName.LastName, '')
What I need is to change this to add the FirstName and LastName only if they are not both NULL. If one of them is not NULL, use that value.
Examples:
- FirstName and LastName are NULL -> NULL
- FirstName is John and LastName is NULL -> John
- FirstName is NULL and LastName is Doe -> Doe
-> indicates the result
