bootstrap easyui RunJS JSFiddle codepen Gist

SQL实战笔记1

select P_CommunityID from T_Person group by P_CommunityID
//创建游标
declare sc cursor scroll for select P_CommunityID from T_Person group by P_CommunityID
open sc
fetch first from sc
close sc
deallocate sc
//使用游标
declare @i int
fetch first from sc into @i
while @i!=541
begin
insert into ff
select TOP 76 * from T_Person where P_CommunityID=@i
fetch next from sc into @i
end
insert into ff
select top 76 * from T_Person where P_CommunityID=541
//随机删除
 delete from [YLBX兰考].[dbo].[ff] where PersonID in(SELECT top 195 PersonID FROM [YLBX兰考].[dbo].[ff] order by newid())

posted @ 2012-08-10 14:56  lvyafei  阅读(113)  评论(0编辑  收藏  举报
博客地址:lvyafei 返回顶部   返回顶部   返回顶部 站长QQ,点击这里给我发消息
无觅关联推荐,快速提升流量