and b.EA_VERSION = '''+@version+'''
--行转列
declare @tem_calss table(id int identity(1,1) primary key,name001 varchar(255),class001 varchar(255),number001 numeric(5,2))
insert into @tem_calss values ('熊伟','物理',100)
select name '姓名',
max(case course when '语文' then number else 0 end) '语文',
max(case course when '数学' then number else 0 end) '数学',
max(case course when '物理' then number else 0 end) '物理'
from @tem_calss group by name
--sql2005中行转列关键词
select * from @tem_calss pivot(max(number) for course in ('语文','数学','物理')) a
--列传行
declare @tem_tablele table (姓名 varchar(10),语文 int,数学 int,物理 int)
insert into @tem_tablele values ('熊敏',100,100,100)
insert into @tem_tablele values ('熊伟',100,100,100)
insert into @tem_tablele values ('熊无名',100,100,100)
select * from @tem_tablele
select * from
(
select 姓名,'语文' 课程,语文 分数 from @tem_tablele
union all
select 姓名,'数学' 课程,数学 分数 from @tem_tablele
union all
select 姓名,'物理' 课程,物理 分数 from @tem_tablele
) t
order by 姓名
--查看长度
print len(@RunSQL)
--分页
String sql = "select top 10 * from shangPin where changPinID not in (select top "+10*(page-1)+" changPinID from shangPin order by changPinID desc) order by changPinID desc";