sql语句之 多列合并为一列
sql 2005
select value from yourtable unpivot ( value for col in (I1, I2, I3) ) un order by id, col;
sql 2008+
select value from yourtable cross apply ( values ('I1', I1), ('I2', I2), ('I3', I3) ) c(col, value) where value is not null order by id, col