1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

How to display the last two charcters in a string

Discussion in 'SQL PL/SQL' started by vnerp@gmail.com, Dec 24, 2012.

Thread Status:
Not open for further replies.
  1. hi all,

    how to display the last two charcters in a string? please give me rly

    thanks
    venkatanaidu
     
  2. Sadik

    Sadik Community Moderator Forum Guru

    Messages:
    1,906
    Likes Received:
    252
    Trophy Points:
    1,455
    Re: HI Oracle Members

    Post your code in the PL/SQL section to get help.
     
  3. Bharat

    Bharat Community Moderator Forum Guru

    Messages:
    1,747
    Likes Received:
    147
    Trophy Points:
    1,805
    Location:
    Vijayawada, India
    Moved the post to SQL PL/SQL section.
     
  4. Bharat

    Bharat Community Moderator Forum Guru

    Messages:
    1,747
    Likes Received:
    147
    Trophy Points:
    1,805
    Location:
    Vijayawada, India
    Hi Venkat,

    here is an example to get last two characters in a string.

    Code (Text):

    SQL> SELECT SUBSTR('ThisIsClubOracle',-2,2)Result from dual;

    Output: -

    Result
    -------
    le
     
    Note: - You can use table columns also in the place of string in substr function.

    For more examples please have a look into the following site.

    Link1
     
    Hamza Bukhari likes this.
Thread Status:
Not open for further replies.