Re: Combining two SELECTs

Поиск
Список
Период
Сортировка
От
Тема Re: Combining two SELECTs
Дата
Msg-id Pine.LNX.4.21.0007041910190.8797-100000@ct36753-a.jfrvil1.in.home.com
обсуждение исходный текст
Ответ на Combining two SELECTs  ("Eric Jain" <jain@gmx.net>)
Список pgsql-general
SELECT count(*), host, url, id
from log
group by host, url, id

You want to include your where and order by clauses - but that should get
you the results your looking for.  I think :)

Steve

On Tue, 4 Jul 2000, Eric Jain wrote:

> 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
>


В списке pgsql-general по дате отправления:

Предыдущее
От: Thomas Good
Дата:
Сообщение: Re: [HACKERS] Re: Revised Copyright: is this more palatable?
Следующее
От: teg@redhat.com (Trond Eivind Glomsrød)
Дата:
Сообщение: Re: responses to licensing discussion