Jose Antonio Esparza Jose Antonio Esparza - 1 year ago 94
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 Source

Oracle? Use a row_number()

select Item, Prov, Costo
select Item, Prov, Costo, row_number() over(partition by Item order by Fecha desc) as Pick_Ord
from Table1
where Pick_Ord =1
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download