Re: Select



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

.



Relevant Pages

  • Re: Select
    ... u2.created) < 1 GROUP BY client_ip, host, uri, referer, agent HAVING ...
    (comp.databases)
  • Re: Select
    ... u1.created FROM user_requests u1 JOIN user_requests u2 USING (client_ip, host, uri, referer, agent) WHERE abs< 1 GROUP BY client_ip, host, uri, referer, agent HAVING ...
    (comp.databases)
  • Re: Select
    ... host, uri, referer, agent HAVING count>1) as a GROUP BY d ORDER BY ... statement and some test data, so I can test it here, too (now all my suggestions are ...
    (comp.databases)
  • Re: Select
    ... (client_ip, host, uri, referer, agent) ... referer, agent HAVING count>1) as a GROUP BY d ORDER BY d; ...
    (comp.databases)
  • Re: Product Review - CORE Impact
    ... CORE IMPACT. ... >run network discovery and found it, ... you can’t evaluate a host until it is present in the entity view ... this agent is actually in the payload of the ...
    (Pen-Test)