sql语法求教
老七 2007-05-30 03:12:37 create table test (a int,数量01月 int,数量02月 int,数量03月 int,数量04月 int,数量05月 int,数量06月 int)
insert into test select 1,100,100,100,100,100,100
union select 1,200,200,200,200,200,200
union select 1,300,300,300,300,300,300
union select 1,400,400,400,400,400,400
Declare @I int
select @I=1
--select 数量+Right(100+@I,2)+月' from test --(语句一)
select [数量01月] from test --(语句二)
drop table test
问题:要求语句二对应@I
如果:select @I=5
结果对应为:select [数量02月] from test