how do you enforce conditional not null check across sql columns
create table A (id, col_A, col_B, col_C)

id = unique id
for every row being persisted either col_A **or** col_B will have a valid value, but both columns will not have a value for each persisted row at the same time.

e.g. insert into A (id, col_A, col_C) values (1, "a", "c")
insert into A (id, col_B, col_C) values (1, "b", "c")
insert into A (id, col_A, col_C) values (1, "aa", "cc")
insert into A (id, col_B, col_C) values (1, "bb", "cc")

note: col_A and col_B cannot be merged into a single column as per design.

I would like to enforce conditional not null check across col_A and col_B based on the above restriction (i.e. for each row atleast col_A or col_B should be present). How do I acheive that?
how do you enforce conditional not null check across sql columns
===

create table A (id, col_A, col_B, col_C)

id = unique id
for every row being persisted either col_A **or** col_B will have a valid value, but both columns will not have a value for each persisted row at the same time.

e.g. insert into A (id, col_A, col_C) values (1, "a", "c")
insert into A (id, col_B, col_C) values (1, "b", "c")
insert into A (id, col_A, col_C) values (1, "aa", "cc")
insert into A (id, col_B, col_C) values (1, "bb", "cc")

note: col_A and col_B cannot be merged into a single column as per design.

I would like to enforce conditional not null check across col_A and col_B based on the above restriction (i.e. for each row atleast col_A or col_B should be present). How do I acheive that?