Results 1 to 3 of 3

Thread: Trimming Data

  1. #1
    Join Date
    Feb 2004
    Posts
    5

    Unhappy Unanswered: Trimming Data

    Post Preview:
    Hi all can some one help me
    I am trying to split AAA to AA and 0
    and GASABN0 to GASABN to 0
    as you can see from the sample data the are a lot of different values
    I would also like to add a number if there isnt on AAA to AA and 0 etc

    This is above my head as I am a jnr dba


    1 OA Abnormality AAA ASSOCIATED ABNORMALITIES YES
    1 OA Abnormality AAA ASSOCIATED ABNORMALITIES NO
    1 OA Abnormality AAA ASSOCIATED ABNORMALITIES NOT RECORDED
    1 OA Abnormality AAG GASTROINTESTINAL ABNORMALITIES YES
    1 OA Abnormality AAG GASTROINTESTINAL ABNORMALITIES NO
    1 OA Abnormality AAG GASTROINTESTINAL ABNORMALITIES NOT RECORDED
    1 OA Abnormality GASABN0 GASTROINTESTINAL ABNORMALITIES DUODENAL ATRESIA
    1 OA Abnormality GASABN1 GASTROINTESTINAL ABNORMALITIES DUDENAL STENOSIS
    1 OA Abnormality GASABN2 GASTROINTESTINAL ABNORMALITIES PYLORIC STENOSIS
    1 OA Abnormality GASABN3 GASTROINTESTINAL ABNORMALITIES GASTROESOPHAGEAL REFLUX

  2. #2
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    select RTRIM(name, '0'), SUBSTR(name, LENGTH(RTRIM(name, '0'))+1) from table;
    Code:
    SQL> select * from test;
    
    NAME
    ----------
    VALUE00
    VALUE0
    
    SQL> select RTRIM(name, '0'), SUBSTR(name, LENGTH(RTRIM(name, '0'))+1) from test;
    
    RTRIM(NAME SUBSTR(NAM
    ---------- ----------
    VALUE      00
    VALUE      0
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

  3. #3
    Join Date
    Feb 2004
    Posts
    5

    Talking thanks :)

    Great stuff

Posting Permissions

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