1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

  2. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

PostgreSQL: running count of rows for a query 'by minute'

Discussão em 'Outras Linguagens' iniciado por Stack, Maio 28, 2021.

  1. Stack

    Stack Membro Participativo

    I need to query for each minute the total count of rows up to that minute.

    The best I could achieve so far doesn't do the trick. It returns count per minute, not the total count up to each minute:

    SELECT COUNT(id) AS count
    , EXTRACT(hour from "when") AS hour
    , EXTRACT(minute from "when") AS minute
    FROM mytable
    GROUP BY hour, minute

    Continue reading...

Compartilhe esta Página