Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: column name as a part of the result set
"Tod" <dontbotherspammers_at_yahoo.com> wrote in message
news:f85005b4.0402130440.e23fbaf_at_posting.google.com...
--snip--
> Not possible to use SP w/o PL/SQL, of course, just dumb typing on my
> part.
>
> I know VAL_COL in this example but I will have 30 columns in the real
> situation. I want to know only (and all) the column names where the
> value in "at" is different than the value in "bt".
>
> Thanks
You can try something like this:
select a.id, a.val1, a.val2, .......,
decode(a.val1, b.val1, 'VAL1',null) val1, decode(a.val2, b.val2, 'VAL2',null) val2, .....
It should spit out the column name if the values are different.
...
Anurag
Received on Fri Feb 13 2004 - 06:53:37 CST
![]() |
![]() |