fastadmin菜单快速排序
select concat('update ck_auth_rule set weigh = ',rn,' where id = ',id,';') as sql_text
from (select id,pid,
100 - row_number() over(partition by pid order by id) as rn
from ck_auth_rule ) t ; select concat('update ck_auth_rule set weigh = ',rn,' where id = ',id,';') as sql_text
from (select id,pid,
100 - row_number() over(partition by pid order by id) as rn
from ck_auth_rule ) t ;