SELECT DISTINCT
MRP.[date], FT.feedtype, ROUND(MRP.rateperkg, 3) AS Rateperkg
FROM
K_FS_FeedMrpDetails MRP
INNER join
K_FPS_feedtype FT ON FT.sno = MRP.feedtype
WHERE
MRP.[date] BETWEEN '2013-08-09 00:00:00.000' AND '2014-08-25 00:00:00.000'
AND MRP.state = 1
AND MRP.rateperkg != 0
GROUP BY
ft.feedtype,mrp.rateperkg
ORDER BY
MRP.[date] desc
在我的查询中有相同的列值feedtype和rateperkg ..
答案 0 :(得分:0)
您不需要一起使用distinct与group。当您在选择SQL Server中使用distinct时,将distinct应用于选择查询的所有列。