On 12 April 2010 22:22, A B <gentosaker@gmail.com> wrote:
>
> first | message | last | count
> --------------------------------------
> 1 | a | 1 | 1
> 2 | b | 4 | 3 <--- here it squeezes
> similar consecutive messages into a single row
> 5 | a | 5 | 1
>
> How do I write such a command?
select min(time) as first, max(time) as last, message, count(*) from
log_table group by message order by 1;
--
Sergey Konoplev
Blog: http://gray-hemp.blogspot.com /
Linkedin: http://ru.linkedin.com/in/grayhemp /
JID/GTalk: gray.ru@gmail.com / Skype: gray-hemp / ICQ: 29353802