Answers for "sql get max id value"

SQL
0

SQL get max per id

select name, max(value)
from out_pumptable
group by name
Posted by: Guest on October-29-2020
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"

Browse Popular Code Answers by Language