DB/Oracle

오라클 유사도순 정렬

lovineff 2020. 6. 4. 17:47
with cte_list as (
  select 'test1234' as title from dual union all
  select 'test' as title from dual union all
  select 'test1' as title from dual union all
  select 'test233' as title from dual union all
  select 'test444' as title from dual union all
  select 'test113' as title from dual union all
  select 'testabdd' as title from dual   
)
select 
	title
from cte_list
where title like '%test%'
ORDER BY UTL_MATCH.EDIT_DISTANCE_SIMILARITY(title, 'test') desc, title
;

'DB > Oracle' 카테고리의 다른 글

자주 사용 함수  (0) 2020.06.10
오라클 DATE to CHAR 변환  (0) 2020.06.04
오라클 원단위 절사  (0) 2020.06.04