22 Ağustos 2011 Pazartesi

MSSQL ile Virtual Table ve UNPIVOT

Ref: http://stackoverflow.com/questions/2113251/tsql-help-with-unpivot

create table #tmp ( ac varchar(100), bc varchar(100), cc varchar(100))

insert into #tmp (ac,bc,cc) Values ('test1','test2','test3')

SELECT * FROM #tmp

SELECT * FROM #tmp
UNPIVOT ( [Column] FOR Data IN (ac, bc, cc)) uPIVOT


drop table #tmp


Sonuç:

Hiç yorum yok:

Yorum Gönder