如何在Postgres sql的列中找到最大值? [英] How do i find the largest value in a column in postgres sql?
本文介绍了如何在Postgres sql的列中找到最大值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
例如:
name | weight
jon 100
jane 120
joe 130
如何只返回体重最大的人的名字?
How do I only return the name of the person with the largest weight?
推荐答案
使用此:
select name
from tbl
where weight = (select max(weight) from tbl)
这篇关于如何在Postgres sql的列中找到最大值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文