Received: from cti13.citenet.net (cti13.citenet.net [206.123.38.75]) by hub.org (8.9.3/8.9.3) with ESMTP id QAA46808 for ; Fri, 31 Mar 2000 16:08:38 -0500 (EST) (envelope-from dziablo@lords.com) Received: from zack (g92-180.citenet.net [209.41.140.180]) by cti13.citenet.net (8.9.2/8.9.1) with SMTP id QAA38079 for ; Fri, 31 Mar 2000 16:10:37 -0500 (EST) From: "Ed" To: "pgsql sql" Subject: Sub select.. Date: Fri, 31 Mar 2000 16:11:13 -0500 Message-ID: <000301bf9b55$a511dd00$b48c29d1@citenet.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 X-Archive-Number: 200003/17 Hi, I would like to know if ther is a way of doing something like this : select max(col1) from (select count(*) as col1 from table1 where index_field = 3 group by day); table1 loking like : day | index_field | ... ------------------------------------- 1 1 1 1 1 3 1 3 2 3 3 1 3 3 Finally, I only want to know the maximum count(*) value grouped by day my sub query should return me : col1 ------- 2 (for day 1) 1 (for day 2) 1 (for day 3) So, Max(col1) would return me " 2 " but... imbriqued select doesn't seems to work in 6.5.3.... Any suggestions? /fb