在這裡做個筆記, 功能是以名稱排序後, update 欄位中的排序欄位(SORT)
update TABLE1 t set t.SORT =
( select RN
from (select ROW_NUMBER() OVER(ORDER BY NAME) RN ,TABLE1.CODE
from TABLE1
where SYSTYPE='TYPE1'
order by nlssort(NAME,'NLS_SORT=TCHINESE_RADICAL_M')
)
where t.CODE = CODE and t.SYSTYPE = SYSTYPE
)
where SYSTYPE='TYPE1'
紀錄一下~
沒有留言:
張貼留言