请问:
表m
a b c d 
1 2 3   
1 2   4 
2 2 3  
2 2   4 
结果
a b c d 
1 2 3 4  
2 2 3 4
如何实现?

解决方案 »

  1.   

    select a,b,max(c),max(d)
    from m
    group by a,b
    == 思想重于技巧 ==
      

  2.   

    这的确能够查询到结果,能够直接update表M吗?
      

  3.   

    这的确能够查询到结果,能够直接update表M吗?
    ---------------
    你想把你的库改成这种形式,要执行几条sql语句才可以实现的。
    update语句不支持max这些函数的。
      

  4.   

    update m set c=3,d=4;select distinct * from m;就是这个意思如果c d列要更改的数要查询 那就先查出来
      

  5.   

    create table tbname select语句
      

  6.   

    create table k 
    select a,b,max(c),max(d)
    from m
    group by a,b
    是不是这样啊?提示出错喔~~~~~