Trimming leading characters in Oracle
Back in February I posted about concatenating values across multiple rows , and for those of you who have used that solution, you may have noticed that there are some leading slashes (or your delimiter of choice) that can be quite annoying. Another developer thought it looked sloppy so I trimmed off the leading characters.The join and everything is the same as the previous article, the only thing that has changed is the select. Since there are no Left nor Right functions in Oracle we had to use substring as seen below:
SUBSTR(TYPELIST, (length(prj.TYPELIST) -2) * -1) as TYPELIST
Just change the 2 from above to however many characters you want to remove and you're all done.
Labels: Oracle
posted by Tom Becker at
10/28/2008
![]()

0 Comments:
Post a Comment
<< Home