文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>每行SQL語句加go換行

每行SQL語句加go換行

时间:2010-09-27  来源:Snowfun

 create table #test01(c1 int identity(1,1) ,c2 nvarchar(2000))

 

--篩選數據後放入表01中

insert into #test01

select  'sp_addlogin ' + '''' + rtrim(ltrim(usrname)) + ''', ' + '''' + rtrim(ltrim(usrname))  + ''''     from maxusergroups

 

--查詢表01的行數再添加字段go

select c1,c2='go'   into #test02   from #test01

 

--創建新表03

create table #test03(c1 int ,c2 nvarchar(2000))

 

--將表01和表02的數據插入到表03中

insert into #test03   select * from #test01

insert into #test03   select * from #test02

 

select * from #test01 order by c1,c2

select * from #test02 order by c1,c2

select * from #test03 order by c1,c2  --最終結果

 

相关阅读 更多 +
排行榜 更多 +
别惹神枪手安卓版

别惹神枪手安卓版

冒险解谜 下载
坦克战争世界

坦克战争世界

模拟经营 下载
丛林反击战

丛林反击战

飞行射击 下载