Help with query

From: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
To: pgsql-sql(at)postgreSQL(dot)org
Subject: Help with query
Date: 1999-03-25 03:13:06
Message-ID: Pine.GSO.3.96.SK.990325060718.16970K-100000@ra
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(at)sai(dot)msu(dot)su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83

Browse pgsql-sql by date

  From Date Subject
Next Message MAILER-DAEMON 1999-03-25 04:57:57 Undeliverable Message
Previous Message Jackson, DeJuan 1999-03-24 22:27:02 RE: [SQL] types and subtypes