Combining two SELECTs

From: "Eric Jain" <jain(at)gmx(dot)net>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Combining two SELECTs
Date: 2000-07-04 20:36:01
Message-ID: NCBBJFHBEGOIAHBCBNCLMEGMCIAA.jain@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Any ideas how the following two statements could be combined into a
single one?

This would greatly simplify the integration of this query into an
existing web interface...

SELECT DISTINCT host, url, id
INTO TEMP
FROM log
WHERE
host IN (SELECT host FROM robots)
AND status IN (200, 304);

SELECT host, COUNT(*) AS hits
FROM TEMP
GROUP BY host
ORDER BY hits DESC;

--
Eric Jain

Responses

Browse pgsql-general by date

  From Date Subject
Next Message planx plnetx 2000-07-04 20:59:04 REFERENCES troubles
Previous Message Tom Lane 2000-07-04 19:20:31 Re: psql dumps core