I’m working with a table which has “Name”, “FirstName”, and “Surname” fields.
“Name” was used years ago but is still supported.
Today though the “FirstName” and “Surname” fields are used instead.
Here’s what I’d like to do for my query on this table. If FirstName and/or Surname are not Null then I want them returned for the row, otherwise I want Name.
FirstName and Surname can be concatenated with a space between, giving just a single field in the returned result. Or maybe you have a better solution.
Thanks you!
Barry
This can be done by either using
COALESCEor using
ISNULLIf Firstname or Surname can be
NULLand you want to return one of these, you would useCOALESCECOALESCE