SQL Server query the data of the row with the largest value

Query the maximum value: select MAX(score) from t_student;

Query the maximum row data: select TOP 1 * from t_student order by score desc;

(mysql写法: select * from t_student order by score desc limit 1)

If there are multiple rows with the maximum value, you can write this:

select * from t_student where score = (select MAX(score) from t_student)

Guess you like

Origin blog.csdn.net/kaiyuantao/article/details/116453550