Skip to content

Instantly share code, notes, and snippets.

@warlley
Created June 4, 2013 12:31
Show Gist options
  • Save warlley/5705555 to your computer and use it in GitHub Desktop.
Save warlley/5705555 to your computer and use it in GitHub Desktop.
select * from (
select pk_codigo_pro, dt_entrada_nfi, preco_unt_nfi,
row_number() over (partition by pk_codigo_pro order by dt_entrada_nfi) as rownumber
from siai.mov_nf_entra_itens
) as a
where a.rownumber = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment