日期:2014-05-18 浏览次数:20541 次
select distinct( proSaleBill.proSaleBillCode), proSaleBill.BusiName , proSaleBill.saleMan, proSaleBill.madeBillDate, proSaleBill.departmentName, proSaleBill.madeBillUser from proSaleBill where mangeReview is null group by proSaleBill.proSaleBillCode, proSaleBill.BusiName, proSaleBill.saleMan, proSaleBill.madeBillDate, proSaleBill.departmentName, proSaleBill.madeBillUser
select proSaleBill.proSaleBillCode, min(proSaleBill.BusiName) BusiName, min(proSaleBill.saleMan) saleMan, min(proSaleBill.madeBillDate) madeBillDate, min(proSaleBill.departmentName) departmentName, min(proSaleBill.madeBillUser) madeBillUser from proSaleBill where mangeReview is null group by proSaleBill.proSaleBillCode
------解决方案--------------------
不知道你最后想怎么取数据,按照你现在的语句,去掉proSaleBill.madeBillDate这列就行了.
------解决方案--------------------
明显madeBillDate不一样,可以格式化一下,只取yyyy-MM-dd
------解决方案--------------------
把除了proSaleBillCode的字段用聚合函数 然后GROUP BY