select a.Billcode,b.col1,b.col2,a.col3 from
(select * from test where col3 is not null)a,
(select * from test where col1 is not null and col2 is not null)b

解决方案 »

  1.   

    select Billcode, col1=max(col1),col2=max(col2),col3=max(col3) from test group by Billcode
      

  2.   

    select Billcode,max(Col1),max(Col2),max(Col3) from tabal1 group by billcode
      

  3.   

    select Billcode,max(Col1),max(Col2),max(Col3) from tabal1 group by billcode
      

  4.   

    Ok搞定了,帮忙都给分, chinaandys(风流泪,雨含笑)的第一个我试了好象不对,谢谢了各位
      

  5.   

    第一个也是对了,我测试了:010101 A B C