delete from rightrelation where righttype = 22011; insert into rightrelation (UserGroupOid, Tid, RightType, IsActive, Version) select oid, 0, 22011, 1, 1 from usergroup;