I have a table with 3 columns (A,B,C).

In each row, only one of the columns is not null.

How do I create a function column or a computed column that will consist from all the non null values?

Something like: column(A or B or C)

1 Answer 1


The syntax for virtual columns is very simple:

  ADD abc AS (COALESCE(a, b, c)) ;

Tested at rextester.com.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.