![]() |
|
Archives of the TeradataForumMessage Posted: Mon, 02 Jul 2007 @ 13:01:54 GMT
Hi, You can try this :
select substring(field from char(field) for 1) ||
substring(field from char(field)-1 for 1) ||
substring(field from char(field)-2 for 1) ||
substring(field from char(field)-3 for 1) ||
substring(field from char(field)-4 for 1) AS REVERSE_STRING
,SUBSTRING(field FROM CHARACTERS(field) - POSITION('_' IN
REVERSE_STRING)+2)
Adapt the substring reverse sequence with max characters following the last '_'. You can also use the UDF. I hope help you Regards
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||