我的现有数据是
indust 200301  200302  200303
--------------------------------
a 111
a 555
a 999现在要转换成
indust 200301  200302  200303
--------------------------------
a 111 555 999
这个SQL语句怎么写呢谢谢!

解决方案 »

  1.   

    如果是
    a 111 
    a 555 
    a 999 
    b 1321
    c 5455
    d 2424
    d 432434这样的数据,你希望是什么结果?
      

  2.   

    有没有看过这个帖子?
    http://topic.csdn.net/u/20080614/17/22e73f33-f071-46dc-b9bf-321204b1656f.html
      

  3.   

    帖子发上去,格式变了
    indust 200301  200302  200303
    --------------------------------
    a       111
    a                555
    a                         999 
      

  4.   

    搞定了!谢了各位select indust,
    [200301]=max([200301]),
    [200302]=max([200302]),
    [200303]=max([200303])
    From test
    Group by indust