Let's say I have a table setup with a few values, including a name, an ID, and a foreign key that references the ID of another table. The name can be null.
When I select all the records from this table, I want to get the name if it is not null. If it is, I want to get the name of the record referenced by the foreign key. It may possible that name of the record referenced by the foreign key can also null.
What are my options?
Which one is better between ISNULL & COALESCE?