27,579
社区成员
发帖
与我相关
我的任务
分享
--> 测试数据: #T
if object_id('tempdb.dbo.#T') is not null drop table #T
create table #T (COL001 varchar(60))
insert into #T
select '【题 名】竞争战略的环境保护评价方法' union all
select '【作 者】樊松林' union all
select '【题 名】现代企业在信息高速公路环境中的变革' union all
select '【作 者】董慧 刘厚嘉' union all
select '【题 名】关于现阶段我国信息社会学研究任务的初步探索' union all
select '【作 者】谢俊贵' union all
select '【题 名】期刊作者的量化研究(续)' union all
select '【作 者】王崇德' union all
select '【题 名】关于情报学学科的名称' union all
select '【作 者】刘植惠' union all
select '【题 名】当代情报学分支学科群体环境机制作用的时空格局' union all
select '【作 者】陈文勇 李蕾'
if object_id('tempdb.dbo.#') is not null drop table #
select id=identity(int,1,1),substring(COL001,6,100) as data into # from #T
select a.data as 提名, b.data as 作者 from # a join # b on a.id=b.id-1 where b.id%2=0
/*
提名 作者
------------------------------------------------------------ ------------------------------------------------------------
竞争战略的环境保护评价方法 樊松林
现代企业在信息高速公路环境中的变革 董慧 刘厚嘉
关于现阶段我国信息社会学研究任务的初步探索 谢俊贵
期刊作者的量化研究(续) 王崇德
关于情报学学科的名称 刘植惠
当代情报学分支学科群体环境机制作用的时空格局 陈文勇 李蕾
*/
select * , px = identity(int,0,1) into tmp from tb
select
max(case px%2 when 0 then col001 else '' end) '题名',
max(case px%2 when 1 then col001 else '' end) '作者'
from tmp
group by px/2
select * , id = identity(int,0,1) into tmp from tb
select
max(case px%2 when 0 then col001 else '' end) '题名',
max(case px%2 when 1 then col001 else '' end) '作者'
from tmp
group by px/2