1
I’m making a select using the CASE WHEN
in Sql Server, so that the existence of a record is checked, if it exists, it selects in a table, otherwise it selects in another table, but the two can return null. Something more or less like this:
CASE WHEN EXISTS(SELECT Id FROM TabelaA WHERE ColA = 10)
THEN
(SELECT ColA from TabelaA WHERE ColA = 10)
ELSE
(SELECT ColA from TabelaB WHERE ColB = 10)
END Column
How to use a ISNULL
in that script so as to avoid a null return of both selects?
I didn’t know that feature. Thank you.
– Ricardo Alves