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

[SQL] Need an help in finding a median in mysql

Discussão em 'Outras Linguagens' iniciado por Stack, Novembro 6, 2024 às 11:03.

  1. Stack

    Stack Membro Participativo

    I have a table like Table name as Duration

    [​IMG]

    Now we need to get the distinct local_hour, local_end_day, count of each local_hour and median of duration each hour.

    I tried to with this

    select distinct local_hour, local_end_day, count(*) , TOP 1 PERCENTILE_CONT (0.5)
    WITHIN GROUP (ORDER BY DURATION asc)
    OVER () AS MEDIAN as FROM Duration

    Continue reading...

Compartilhe esta Página