How do I use ROW_NUMBER()?

前端 未结 13 2414
青春惊慌失措
青春惊慌失措 2020-11-28 02:35

I want to use the ROW_NUMBER() to get...

  1. To get the max(ROW_NUMBER()) --> Or i guess this would also be the count of all rows
13条回答
  •  春和景丽
    2020-11-28 03:27

    select 
      Ml.Hid,
      ml.blockid,
      row_number() over (partition by ml.blockid order by Ml.Hid desc) as rownumber,
      H.HNAME 
    from MIT_LeadBechmarkHamletwise ML
    join [MT.HAMLE] h on ML.Hid=h.HID
    

提交回复
热议问题