选择分组中的最小列

select t.PlaceId,t.wheatid,t.x,t.y,t.dbz,t.cjz,t.smj
From (select m.PlaceId,MIN(m.OS) AS OS
FROM InitData AS m
GROUP BY m.PlaceId
) q
left join initdata t on t.PlaceId=q.PlaceId and t.OS=q.OS
order by t.PlaceId

你可能感兴趣的:(JOIN)