SQL how to find rows which have highest value of specific column

前端 未结 6 395
花落未央
花落未央 2021-01-19 23:37

For example, the table has columns MYINDEX and NAME.

MYINDEX | NAME
=================
1       | BOB
2       | BOB
3       | CHARLES

Ho do

6条回答
  •  逝去的感伤
    2021-01-19 23:56

    If you wanted to see the highest index for name = 'Bob', use:

    SELECT MAX(MYINDEX) AS [MaxIndex]
    FROM myTable
    WHERE Name = 'Bob'
    

提交回复
热议问题