DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: case statement

  1. #1
    Join Date
    Apr 2002
    Posts
    135
    is it possible to use the case exp inside a select query

    eg:

    select 'callduration'=
    case when
    starttime <>'1/1/1900' then starttime-endtime
    else 0
    end case from table1





  2. #2
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Code:
    select 'callduration=' || 
           case
             when starttime <> TO_DATE('01/01/1900','mm/dd/yyyy') then endtime-starttime
             else 0
           end case
    from table1;
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

Posting Permissions

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


Click Here to Expand Forum to Full Width