oracle 字符串排序


WITH temp0 AS
(SELECT LEVEL lv FROM dual CONNECT BY LEVEL <= 100)

SELECT MAX(REPLACE(sys_connect_by_path(str, ' '), ' ', '')) f1
FROM (SELECT str, row_number() over(ORDER BY ascii(str) ASC) rn
FROM (SELECT substr(t.vals, tv.lv, 1) str
FROM (SELECT '李富財a' AS vals, length('李富財a') AS cnt
FROM dual s
/* WHERE s.f = '李富財'*/) t
JOIN temp0 tv
ON tv.lv <= t.cnt))
START WITH rn = 1
CONNECT BY rn - 1 = PRIOR rn;


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM