Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Location
    inida
    Posts
    62

    Thumbs up Unanswered: 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.

  2. #2
    Join Date
    Apr 2003
    Location
    Minneapolis, MN
    Posts
    273

    Re: DECODE - need an alias NAME..

    Originally posted by neema

    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.
    No, it is not possible. You will get "DATA" as an Alias name regardless of the DECODE truns out true or false.
    Bhavin

    MS Computer Science
    OCP DBA 9i/8i

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •