SQL: How can I return the highest ranking record of similar records, based on one column value?

前端 未结 4 2034
無奈伤痛
無奈伤痛 2021-01-27 23:22

This seems like it should be easier than I\'m finding it. I have a table that contains both first and last names (specified by a type ID) and a frequency of how common the name

4条回答
  •  [愿得一人]
    2021-01-28 00:16

    Top 5 most common first names:

    select Name
      from Names
      where NameType = 1
      order by FrequencyPercent desc
      limit 5;
    

提交回复
热议问题