DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: How to get rid of trailing characters (trim doesn't work)

  1. #1
    Join Date
    Nov 2000
    Posts
    39
    Hello,

    Could someone help me out with this one:

    I have several strings which lookk like this:

    P830201001
    Q450302001
    L659832001

    In my sql statement, I need to compare only the 7th character of this string. How do I get rid of the 6 initial ones and 3 trailing ones?

    Any help would be most appreciated.

  2. #2
    Join Date
    Feb 2001
    Posts
    163
    select substr(colname, 6,1) from table;

    that should do it.

    syntax is substr(column, startposition, length)

    hope that helps

    uday

  3. #3
    Join Date
    Nov 2000
    Posts
    39
    Thank you. It worked.

Posting Permissions

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


Click Here to Expand Forum to Full Width