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
;