GROUP BY 不能比较或排序 text、ntext 和 image 数据类型,除非使用 IS NULL 或 LIKE 运算符。

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zisongjia/article/details/80690012

 E11_Remarks是text,不能group by ,用方法cast。   

         select  E11_PurchaseOrderID ,
                    E11_ItemID,
                    E11_ItemModel,
                    sum(E11_Qty) as E11_Qty,
                    E11_Manufacturer,
                    E11_WHID,                    
                    E11_UnitPrice,
                    E11_InStoreDate,
                    cast(E11_Remarks as varchar(4000)) as E11_Remarks,
                    E11_RsvedFld
                    
           from     E11_ServiceItemStore  
                    
           group by E11_PurchaseOrderID,
                    E11_ItemID,
                    E11_ItemModel,
                    E11_Manufacturer,
                    E11_WHID,                    
                    E11_UnitPrice,
                    E11_InStoreDate,
                    cast(E11_Remarks as varchar(4000)),
                    E11_RsvedFld

阅读更多
想对作者说点什么?

博主推荐

换一批

没有更多推荐了,返回首页