Choose one of two values

From: Sashi <>
Date: Mon, 28 Sep 2009 07:40:31 -0700 (PDT)
Message-ID: <>

Hi all,

I'm running a simple select stmt thus:

select A.value, b.value
from A, B
where ...

However, either A.value or B.value is null and I need to select the non null value.
Is there a way of specifying within pl/sql this construct?


Select ( if (A.value) is null and (B.value) is not null then B.value

            if (B.value) is null and (A.value) is not null then
            if (B.value) is not null and (A.value) is not null then
From A, B
where ...

In the third case above, either is ok so I arbitrarily cose A.value.

Hope this is clean enough.

Thanks in advance,
Sashi Received on Mon Sep 28 2009 - 09:40:31 CDT

Original text of this message