How to return not null column for a set of values in ref cursor
Hi All,
I am on Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
We have the following table structure -
Col1
Col2
Rate
Amount
Col1 Col2 Rate Amount
A B 10
C D 20
E F 30
As can be seen in above example, either Rate or Amount will be populated for a combination of Col1 and Col2.
We will have the input parameters as Col1 and Col2.
I have to write a Ref Cursor to return the 3 values i.e. Col1, Col2, Rate/Amount (whichever is not null).
Is it possible to have a single query which fetches the respective value with the correct column name i.e