Answers for "sql server select record with max id"

SQL
0

sql server select record with max id

select ID , ProductCatId , ProductCode , Price
  from (
        select ID , ProductCatId , ProductCode , Price, row_number() over (partition by ProductCatId order by ID desc) as rn
         from myTable
        ) as t
  where t.rn = 1
Posted by: Guest on December-17-2020

Code answers related to "sql server select record with max id"

Code answers related to "SQL"

Browse Popular Code Answers by Language