Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id DF2C29FA07F for ; Tue, 28 Aug 2007 10:13:25 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 18042-04 for ; Tue, 28 Aug 2007 10:13:15 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from depesz.com (depesz.com [88.198.37.40]) by postgresql.org (Postfix) with ESMTP id 42A0C9FA02E for ; Tue, 28 Aug 2007 10:13:21 -0300 (ADT) Received: from depesz by depesz.com with local (Exim 4.63) (envelope-from ) id 1IQ0sh-0000KL-2V; Tue, 28 Aug 2007 15:13:19 +0200 Date: Tue, 28 Aug 2007 15:13:19 +0200 From: hubert depesz lubaczewski To: Michael Glaesemann Cc: Claudia Kosny , pgsql-sql@postgresql.org Subject: Re: fetch first rows of grouped data Message-ID: <20070828131319.GA1229@depesz.com> Reply-To: depesz@depesz.com References: <46D2FD9F.3020000@gmx.net> <20070828091421.GB19637@depesz.com> <2A02E93C-62E7-4D94-8559-B0999835698F@seespotcode.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <2A02E93C-62E7-4D94-8559-B0999835698F@seespotcode.net> User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/237 X-Sequence-Number: 29175 On Tue, Aug 28, 2007 at 08:00:42AM -0500, Michael Glaesemann wrote: > >you can try to use "distinct on". > I considered that as well, but couldn't think of a way to return more you're right and i was wrong. i simply missed the word "two" in original question. sorry. depesz -- quicksil1er: "postgres is excellent, but like any DB it requires a highly paid DBA. here's my CV!" :) http://www.depesz.com/ - blog dla ciebie (i moje CV)