
March 1st, 2004, 12:11 AM
|
|
Registered User
|
|
Join Date: Jan 2004
Posts: 11
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
DECODE - need an alias NAME..
hi,
please find the following query
select SL_NO,
decode( STAT_PERFORMING,0, (decode( STAT_SUBSTD, 0 ,(decode( STAT_DOUBTFUL, 0 , (decode( STAT_LOST, 0 ,
(decode( STAT_GOVT_PERF, 0 , (decode( STAT_GOVT_NON_PERF, 0 , (decode( STAT_SPL_MENTION, 0 , 0, STAT_SPL_MENTION)),
STAT_GOVT_NON_PERF)), STAT_GOVT_PERF)), STAT_LOST)), STAT_DOUBTFUL)), STAT_SUBSTD)), STAT_PERFORMING)DATA
from tfe_cred_classification where ACCOUNT_NO = 'sb001'
Here for the output returned by DECODE function, i've given an alias DATA, is there any way to display the selected column name as alias??
I mean if the first DECODE is getting worked in false part i'vll be getting the datas on STAT_PERFORMING column. In that case i want STAT_PERFORMING as the alias name.
Any kind of suggetions are higly appreciated.
Thanx.
|