Skip to content
Advertisement

How do I find the largest value in a column in postgres sql?

For example:

name | weight
jon    100    
jane   120    
joe    130

How do I only return the name of the person with the largest weight?

Advertisement

Answer

Use this:

select name
from tbl
where weight = (select max(weight) from tbl)
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement