Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> For one example filtering on aggregates is not supported by MySQL, MS SQL, Oracle or most other DBMS's.

HAVING is one of the standard clauses, I use it on mysql all the time and a quick search shows it exists for the others.



I'm not talking about HAVING, I'm talking about item #25: filter aggregate inputs. Queries like

    select
        sex,
        round(
            avg(body_mass_g) filter (where body_mass_g < 4000.0),
            1
        ) as average_mass_g
    from penguins
    group by sex;




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: