Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id f8NI3pe05019 for ; Sun, 23 Sep 2001 14:03:51 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.4/8.11.4) id f8NHnSg99055 for pgsql-sql@postgresql.org; Sun, 23 Sep 2001 13:49:28 -0400 (EDT) (envelope-from news) From: bulk@colonnello.org (Paolo Colonnello) X-Newsgroups: cz.comp.microsoft.sql, mailing.database.sql-general, comp.databases.ms-sqlserver, comp.databases.postgresql.sql Subject: Re: Simple Query HELP!!! Date: 23 Sep 2001 10:49:27 -0700 Organization: http://groups.google.com/ Lines: 14 Message-ID: References: <3bad5086.29922681@news.charter.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: groups-abuse@google.com To: pgsql-sql@postgresql.org X-Archive-Number: 200109/246 X-Sequence-Number: 4928 reb_01501@yahoo.com (Bob Barrows) wrote in message news:<3bad5086.29922681@news.charter.net>... > Do you care about ties? What if Ingrid, 38 yrs old, worked at IBM? > Would you want to show both Ingrid and Maria? If so, this will work: > > Select Name From People t1 Inner Join > (Select Company, Max(Age) As Oldest FROM People > Group By Company) t2 > ON t1.Company = t2.Company AND t1.Age = t2.Oldest > Thanks a lot, the query work perfect! I dont care about ties... this is just the query I need... Bye