如何仅转置单列,保持一列相同?

时间:2017-06-28 09:29:29

标签: sql sas

我如何这样转置? 我知道完全转移它,但这个我不熟悉。 enter image description here

1 个答案:

答案 0 :(得分:0)

这应该做的工作:

data a;
  cust = "A";
  channels = 20;
  output;
  cust = "A";
  channels = 30;
  output;
  cust = "A";
  channels = 40;
  output;
  cust = "B";
  channels = 200;
  output;
  cust = "B";
  channels = 300;
  output;
  cust = "B";
  channels = 0;
  output;
run;

proc transpose data=a out=b;
  by cust;
  var channels;
run;