0

A table contains bind dns queries in a way like this:

10.30.2.218 | 86.214.218.178.in-addr.arpa|25.09.13 10:32:29,774000000

that is "client ip","query","query time"(as a timestamp) I've been trying to come up with an SQL request that counts number of queries groupped for an ip address, but per second. And still fail. I've tried this query:

select to_char(log_time, 'HH24:MI:SS'),log_client,count(*) from msint
group by log_time,log_client
order by 3 desc;

but it returns groupping by milliseconds and not seconds as I need. I'd be very greatful if you give me a hint how to get "per second requests".

4

1 回答 1

0

按函数结果分组,而不是字段。换句话说,

group by to_char(log_time, 'HH24:MI:SS'), log_client
于 2013-09-25T12:38:54.057 回答