X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 9079A9FB1BF for ; Thu, 20 Jul 2006 18:13:46 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 74607-01-8 for ; Thu, 20 Jul 2006 18:13:41 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from web31813.mail.mud.yahoo.com (web31813.mail.mud.yahoo.com [68.142.207.76]) by postgresql.org (Postfix) with SMTP id CF0819FA5E9 for ; Thu, 20 Jul 2006 17:47:53 -0300 (ADT) Received: (qmail 51891 invoked by uid 60001); 20 Jul 2006 20:47:52 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=zHedIxgL8RSYtvWRz6Vh4iYhEG7QOy0cShZXD+DeJEAiqUDYrhrwtw4ktSzuK2iqbL8g5TU5XnmqDVrtGGTCr7D8i8iZbuuZAJadxqvcSZ1QKWZIw066MwvMtJH6swlgBZqfcdS4KD2l95dzaRppAd76Dr2SCOHRBTMEtn7VVV4= ; Message-ID: <20060720204752.51889.qmail@web31813.mail.mud.yahoo.com> Received: from [65.211.203.126] by web31813.mail.mud.yahoo.com via HTTP; Thu, 20 Jul 2006 13:47:52 PDT Date: Thu, 20 Jul 2006 13:47:52 -0700 (PDT) From: Richard Broersma Jr Subject: Re: simple problem??? To: marchesini@unipg.it, pgsql-sql@postgresql.org In-Reply-To: <1153407157.5192.64.camel@geoivan> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=2.798 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, DNS_FROM_RFC_WHOIS X-Spam-Level: ** X-Archive-Number: 200607/269 X-Sequence-Number: 25843 > A|B|C > 1|2|20 > 1|3|10 > 1|4|21 > 2|3|12 > 2|4|22 > 3|4|23 > 1|3|10 > 2|3|12 > 3|4|23 > -select all records where A=1, > -find, into this selection, the record where there's the minimum value > of the field C > -print all the fields for this record. maybe this will work; select a,b,c from table as T1 join (select a, min(c) as minc from table group by a) as T2 on (t1.a = t2.a) and (t1.c = t2.c) ; Regards, Richard Broersma Jr.