Home Page for the TeradataForum

Archives of the TeradataForum

Message Posted: Fri, 02 Jul 2004 @ 16:40:34 GMT

  <Prev Next>   <<First <Prev Next> Last>>  

Subj:   Re: Substr question
From:   Babu, Mahesh

I don't think you can use a -ve number as outbounds. You can use the following SQL to SUBSTR backward.

     characters(trim('265CPI0')) Chrs,
     '265CPI0' Strng,
      1 offset,
     substr(strng, (chrs - offset) , ( chrs - (chrs - (offset + 1)) ) ) ;

Incrementing the offset value will SUBSTR the string backward. May be you could use a derived table and CROSS JOIN it to automate the offset increment part.



  <Prev Next>   <<First <Prev Next> Last>>  
  Top Home Privacy Feedback  
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023