解决方案 »

  1.   

    表的元数据能贴出来吗?
    group by h_contents,h_update order by id asc
    你这个没法按照ID排序。不在聚合函数也不再GROUP BY之中啊
      

  2.   

    我去掉order by 也不对呀 
    还是提示
    不能比较或排序 text、ntext 和 image 数据类型
      

  3.   

    h_contents 是ntext类型
    h_update 是字符串 我就不明白
    使用聚合函数了 就必须要把非聚合的group by 出来
    可是 ntext,image 又不能group by 那怎么办
      

  4.   


    大数据类型肯定是不能group by的,不管是在什么数据库,都是这样。所以你还不如,单独计算一个h_contents字段的md5值,作为group by的依据呢
      

  5.   

    或者 如果你存储的字节数没有超过8000个,那么在2005及以后的版本,可以考虑这样:
    select cast(h_contents as varchar(8000)) h_contents,h_update,count(1) from huida where ********* 
    group by cast(h_contents as varchar(8000)),h_update order by id asc
      

  6.   

    建议将h_contents字段改为nvarchar(max)类型.
      

  7.   

    建议用varchar(max),nvarchar(max),binary(max)来代替