X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0ACFC3A5D9D for ; Wed, 12 Jan 2005 18:33:52 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 57363-09 for ; Wed, 12 Jan 2005 18:33:49 +0000 (GMT) Received: from school.digsys.bg (school.digsys.bg [193.68.6.1]) by svr1.postgresql.org (Postfix) with ESMTP id ACFD63A5D95 for ; Wed, 12 Jan 2005 18:33:47 +0000 (GMT) Received: from faith.digsys.bg (sigma.digsys.bg [193.68.6.19]) by school.digsys.bg (8.11.6/8.10.1) with ESMTP id j0CIXcD13552; Wed, 12 Jan 2005 20:33:38 +0200 (EET) Message-ID: <41E56F33.8020208@faith.digsys.bg> Date: Wed, 12 Jan 2005 20:40:51 +0200 From: Kaloyan Iliev Iliev User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040115 X-Accept-Language: en-us, en, bg MIME-Version: 1.0 To: Michael Fuhr Cc: pgsql-sql@postgresql.org Subject: Re: Problems with HAVING References: <41E5529B.9030609@faith.digsys.bg> <20050112171121.GA94838@winnie.fuhr.org> <20050112174130.GA95306@winnie.fuhr.org> In-Reply-To: <20050112174130.GA95306@winnie.fuhr.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.073 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200501/69 X-Sequence-Number: 19857 Thank You, That's what I need. I know it was something simple but... Now it works perfectly. Thank's again. Kaloyan Iliev Michael Fuhr wrote: >On Wed, Jan 12, 2005 at 10:11:21AM -0700, Michael Fuhr wrote: > > >>On Wed, Jan 12, 2005 at 06:38:51PM +0200, Kaloyan Iliev Iliev wrote: >> >> >> >>>My problem is that I want to select the row with max(date) but also >>>limited with where clauses. >>> >>> >>If you don't mind using a non-standard feature then try SELECT >>DISTINCT ON (not just DISTINCT, but DISTINCT ON): >> >> > >Sorry, I probably didn't read your message closely enough. If you >just want a single record then ORDER BY ... LIMIT 1 might be more >appropriate. > > >