如在MySQL中操作:
create table table1(id int auto_increment primary key,name varchar(50),price float default 0);
insert into table1(name,price) values('玉米',10);
insert into table1(name,price) values('大米',20);
insert into table1(name,price) values('小麥',30);
insert into table1(name,price) values('西瓜',40);
insert into table1(name,price) values('玉米',15);
insert into table1(name,price) values('大米',16);
insert into table1(name,price) values('小麥',35);
insert into table1(name,price) values('西瓜',36);
解決方案:
select name,min(price) from table1 group by name order by price;