postgresql - How to find minimum values in a column in sql -
if have table this:
id name value 1 abc 1 2 def 4 3 ghi 1 4 jkl 2
how can select new table still has id, name, value
ones minimum value.
in example need table back:
1 abc 1 3 ghi 1
finding values pretty straightforward:
select * yourtable value = (select min(value) yourtable);
as right syntax putting rows in table, depend on database engine using.
Comments
Post a Comment