Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2008
    Posts
    40

    Unanswered: sequential increase [PL/SQL]

    Can i do something for sequential increase by certain type.

    hmm... For example those whose name starts with 'A' get $200 salary
    , 'B' gets $400, 'C' gets $600, 'D' gets $800.., etc.

    A-Z
    salary increses by $200.

    P.S This is just an example. And i know this is stupid example indeed.

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >Can i do something for sequential increase by certain type.
    I suspect you can not, because if you could do so, you would not have made this post.


    http://download.oracle.com/docs/cd/B...htm#sthref2844
    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
    Mar 2008
    Posts
    40
    hmm...

    100 + 1 gives next value of 100 which is 101.

    So just like that A + 1 or someway to find next value of A which is B.

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Code:
    SQL> select chr(65) from dual;
    
    C
    -
    A
    
    SQL> select chr(66) from dual;
    
    C
    -
    B
    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.

  5. #5
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Are you looking for something like this?
    Code:
    SQL> SELECT CHR(64 + LEVEL), 200 * LEVEL salary
      2  FROM dual
      3  CONNECT BY LEVEL <= 26;
    
    C     SALARY
    - ----------
    A        200
    B        400
    C        600
    D        800
    E       1000
    F       1200
    G       1400
    H       1600
    I       1800
    J       2000
    K       2200
    L       2400
    M       2600
    N       2800
    O       3000
    P       3200
    Q       3400
    R       3600
    S       3800
    T       4000
    U       4200
    V       4400
    W       4600
    X       4800
    Y       5000
    Z       5200
    
    26 rows selected.
    
    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
  •