Results 1 to 3 of 3

Thread: format

  1. #1
    Join Date
    Sep 2011
    Posts
    1

    Unanswered: format

    Hello.,

    this is the first time i posting my questing please help me ASAP.

    i have written a query with diffrent tables and it retrived the output then i have to do calcualation using the output for example:
    i have two columns
    Current salary New Salary
    1000 2000
    3000 6000
    7000 9000

    I want result like diffrentiation like (new salary - current salary) is there any way to print that output along with those columns. then it could be easy for my calculation part.

    Please help me

    Most appriciated for spending your valuable time in advance

    Thank you,
    Nageswar.

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    do like below
    Code:
    Current salary New Salary Salary Difference
    1000                2000            1000
    3000                6000            3000
    7000                9000            2000
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Simply subtract these values and display the result along with them:
    Code:
    SQL> with test as
      2    (select 1000 cur_sal, 2000 new_sal from dual union all
      3     select 3000, 6000 from dual union all
      4     select 7000, 9000 from dual
      5    )
      6  select cur_sal, new_sal, new_sal - cur_sal difference
      7  from test;
    
       CUR_SAL    NEW_SAL DIFFERENCE
    ---------- ---------- ----------
          1000       2000       1000
          3000       6000       3000
          7000       9000       2000
    
    SQL>

Posting Permissions

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