From: Oleg Bartunov <oleg@sai.msu.su>
To: pgsql-sql@postgreSQL.org
Subject: Help with query
Date: Thu, 25 Mar 1999 06:13:06 +0300 (MSK)
Message-ID: <Pine.GSO.3.96.SK.990325060718.16970K-100000@ra> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: oleg@sai.msu.su
Subject: Re: Help with query
In-Reply-To: <Pine.GSO.3.96.SK.990325060718.16970K-100000@ra>
References: <Pine.GSO.3.96.SK.990325060718.16970K-100000@ra>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox