L
love_yb97
Unregistered / Unconfirmed
GUEST, unregistred user!
如:YMD DL_001 DL_002 DL_003 DL_004
20080401 123 456 567 789
20080402 234 345 567 123
..................
要求转换后得到:
YMD 20080401 20080402 ......
DL_001 123 234 .....
DL_002 456 345 .....
DL_003 567 567 .....
DL_004 789 123 .....
创建测试表:
--创建测试表
create table test(YMD varchar(10)
,[DL_001] INT
,[DL_002] INT
,[DL_003] INT
,[DL_004] INT)
insert test select '20080401','111','222','333','444'
union all select '20080402','444','555','666','565'
union all select '20080403','777','888','999','356'
go
请大虾们帮我解决一下,最好给出详细的语句,谢过了!!!
20080401 123 456 567 789
20080402 234 345 567 123
..................
要求转换后得到:
YMD 20080401 20080402 ......
DL_001 123 234 .....
DL_002 456 345 .....
DL_003 567 567 .....
DL_004 789 123 .....
创建测试表:
--创建测试表
create table test(YMD varchar(10)
,[DL_001] INT
,[DL_002] INT
,[DL_003] INT
,[DL_004] INT)
insert test select '20080401','111','222','333','444'
union all select '20080402','444','555','666','565'
union all select '20080403','777','888','999','356'
go
请大虾们帮我解决一下,最好给出详细的语句,谢过了!!!