Select Detalle.IDPROVEEDOR, Filtro.FechaMax, Detalle.Proveedor, Detalle.Fecha
From MATERIASPRIMASDET Detalle
Inner Join (
Select IDPROVEEDOR, max(fecha) FechaMAx
From MATERIASPRIMASDET
where IDMATERIAPRIMA = 61
group by idproveedor
) Filtro
On Detalle.IDPROVEEDOR = Filtro.IDPROVEEDOR And
Detalle.Fecha = Filtro.FechaMAx