Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2012
    Posts
    36

    Unanswered: Removing Leading Charactes

    Hello friends,

    I have a column whose length is 19 and i need to remove the leading 3 charactes ('000') from the column.
    Its a Varchar column
    Can anybody help me On This.??

    Thanks in advance

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    SUBSTR function is a simple way to do that.
    Code:
    SQL> select substr('123Littlefoot', 4, 16) from dual;
    
    SUBSTR('12
    ----------
    Littlefoot
    
    SQL>

  3. #3
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    That will work if EVERY column starts with "000", if they don't the something like

    update my_table
    my_column = substr(my_column,4)
    where my_column like '000%';
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

Posting Permissions

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