Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Posts
    51

    Unanswered: decode statement

    If paytype='overtime' then
    calc1=totalhrs*hourlyrate*1.5 else
    calc1=totalhrs*hourlyrate
    end if

    how to write this using decode
    sampath gowri

  2. #2
    Join Date
    Apr 2003
    Location
    Greenville, SC (USA)
    Posts
    1,155
    select decode(paytype,'overtime',(hourly_rate*1.5),hourly rate)
    from yourtablename ...

    Gregg

  3. #3
    Join Date
    May 2004
    Location
    Dominican Republic
    Posts
    721
    select totalhrs * hourlyrate * decode( paytype, 'overtime', 1.5, 1 )
    from yourtable

Posting Permissions

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