标签:
DECLARE M VARCHAR(10); BEGIN FOR I IN ( WITH T AS (SELECT REVERSE(‘i,am,a,test,hahahhah‘) AS STR FROM DUAL) SELECT LEVEL, REGEXP_SUBSTR(T.STR, ‘[^,]+‘, 1, LEVEL) STR_SINGLE FROM T CONNECT BY LEVEL <= LENGTH(T.STR) - LENGTH(REPLACE(T.STR, ‘,‘, ‘‘)) + 1) LOOP SELECT REVERSE(I.STR_SINGLE) INTO M FROM DUAL; DBMS_OUTPUT.PUT_LINE(M); END LOOP; END;
使用 REVERSE()函數反轉子串。
标签:
原文地址:http://www.cnblogs.com/kuangxiangnice/p/5362084.html