Hi, I don't know what your problem is, exactly. However, I suspect that you have to alias the second "fruits" as well:
select f.type, f.variety, f.price from fruits f where f.rowid in (select f1.rowid from fruits f1 where f1.type = f.type order by f2.price desc limit 1) order by f.type asc, f.price desc; Martin Hariyanto Handoko wrote: > I still sqlite 2.8.17. Can someone help me to convert this sql? > tx > > select f.type, f.variety, f.price > from > fruits f > where > rowid in (select rowid from fruits where type = f.type order by > price desc limit 1) > order by f.type asc, f.price desc; > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users