日期:2014-05-18 浏览次数:20492 次
declare @i int,@id int,@j int,@temp int set @i = 1 select @j = count(*) from com_user where user_id >14592 while @i < @j begin select @temp = COUNT(*) from com_user where user_id =(14592 +@i) select @id = user_id from com_user where user_id =(14592 +@i) while @temp <> 0 begin insert into com_group_user(group_id,user_id)values('SYS_全体人员群组',@id) set @i=@i+1 end end