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

Thread: Substring

  1. #1
    Join Date
    Jan 2002
    Posts
    152
    I've got a select and I want to delete the last 5 characters.
    Can I do it with subst.My example is:
    v_select:='select .....'
    substr(v_select,1,3)
    But if I don't know that the final character is in 3rd position,how can I do it without counting all the characters...
    Thanks

  2. #2
    Join Date
    Apr 2001
    Location
    Czechia
    Posts
    712
    The easiest way is counting all the characters:
    substr(v_select, 1, length(v_select)-5)

  3. #3
    Join Date
    Jan 2002
    Posts
    152
    Thanks ales!

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