Received: from ra.sai.msu.su (ra.sai.msu.su [158.250.29.2]) by hub.org (8.9.2/8.9.1) with ESMTP id WAA23992 for ; Wed, 24 Mar 1999 22:13:15 -0500 (EST) (envelope-from oleg@sai.msu.su) Received: from ra (ra [158.250.29.2]) by ra.sai.msu.su (8.9.1/8.9.1) with SMTP id GAA18384 for ; Thu, 25 Mar 1999 06:13:06 +0300 (MSK) Date: Thu, 25 Mar 1999 06:13:06 +0300 (MSK) From: Oleg Bartunov X-Sender: megera@ra To: pgsql-sql@postgreSQL.org Subject: Help with query Message-ID: Organization: Sternberg Astronomical Institute (Moscow University) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Hi, I have query select source,max(up_date),count(*) from flats group by source which gets me source | max|count --------------------------+----------+----- where source is a company name, max(up_date) - the last update, count - total number of items for giver company but I need source | max| count_updates --------------------------+----------+----- where count_updates is a number of *last updated* items for given company ? How I can do this with SQL ? Best regards, Oleg _____________________________________________________________ Oleg Bartunov, sci.researcher, hostmaster of AstroNet, Sternberg Astronomical Institute, Moscow University (Russia) Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/ phone: +007(095)939-16-83, +007(095)939-23-83