Re: Select
- From: fritz-bayer@xxxxxx
- Date: 21 Aug 2005 03:41:07 -0700
Thanks for the explanation. I wouldn't have come up with the idea of
joining the table to itself to solve the problem. Are there any
sscenraios where you would do that?
Well, now I tried to use the extract function to get the seconds since
the epoch using the following statement:
SELECT to_char(a.created,'YYYY-MM-DD') as d, count(*) FROM (SELECT
u1.created FROM user_requests u1 JOIN user_requests u2 USING
(client_ip, host, uri, referer, agent) WHERE abs(extract(epoch from
u1.created) - extract(epoch from u2.created)) < 1 GROUP BY client_ip,
host, uri, referer, agent HAVING count(*)>1) as a GROUP BY d ORDER BY
d;
But I get the following error:
ERROR: column "u1.created" must appear in the GROUP BY clause or be
used in an aggregate function
.
- Follow-Ups:
- Re: Select
- From: Stefan Rybacki
- Re: Select
- References:
- Select
- From: fritz-bayer
- Re: Select
- From: Stefan Rybacki
- Re: Select
- From: fritz-bayer
- Re: Select
- From: Stefan Rybacki
- Select
- Prev by Date: CSV file conversion
- Next by Date: Re: Select
- Previous by thread: Re: Select
- Next by thread: Re: Select
- Index(es):
Relevant Pages
|
|