Jose Antonio Esparza Jose Antonio Esparza - 2 months ago 16
SQL Question

get registry with the greatest date

i have a problem, this is my table enter image description here

I want to get the items that are most date, for example:
X_1 sp0127 0.00018
X_2 sp0125 0.004

Answer

Oracle? Use a row_number()

select Item, Prov, Costo
from 
(
select Item, Prov, Costo, row_number() over(partition by Item order by Fecha desc) as Pick_Ord
from Table1
)
where Pick_Ord =1