Insert into select group by and order by

Sử dụng câu lệnh insert 1 loạt

insert into tbl_account_logcat (id,code,name)
select ROW_NUMBER() OVER (ORDER BY code asc) R,code,'' 
from tbl_account_log 
group by code 
order by code asc