UPDATE t_perm_userpermdetail a SET (fuserid, fdimid, fdimtype, fisincludesub) = 
(
SELECT b.fuserid, b.forgid, c.fbizobjectid, b.fisincludesuborg 
FROM t_perm_userperm b 
inner join t_perm_ctrltype c on b.fdimtype=c.fnumber
where b.fid = a.fid
) where a.fid in (SELECT fid FROM t_perm_userperm WHERE fdimtype<>' ');