Re: Grouping logs by ip and time
| От | John R Pierce |
|---|---|
| Тема | Re: Grouping logs by ip and time |
| Дата | |
| Msg-id | 4EB97BA0.5080300@hogranch.com обсуждение исходный текст |
| Ответ на | Re: Grouping logs by ip and time (Raymond O'Donnell <rod@iol.ie>) |
| Ответы |
Re: Grouping logs by ip and time
|
| Список | pgsql-general |
On 11/08/11 10:48 AM, Raymond O'Donnell wrote:
> Would something like this work? -
>
> select ip, max("time") - min("time") as session_duration
> from log_table
> group by ip;
>
> This doesn't take the date into account - what happens if the session
> spans midnight? You can get around this by using a timestamp column
> instead of separate date and time.
he said a session always starts with 'action1', and presumably there can
be more than one session per day, so this won't work. the 'end' of a
session is presumably the previous action2|3|4|5 thats prior to the next
action1. I have no idea how you'd code this as a SQL query.
--
john r pierce N 37, W 122
santa cruz ca mid-left coast
В списке pgsql-general по дате отправления: