News for hackers. Stuff that matters.
Re:SQL or Death? Seminar Series – Spring 2025 – Carnegie Mel... by _dain_ on Sunday February 02, 2025 @04:03AM (#42907324)
WHERE and HAVING (and QUALIFY) are redundant. The PRQL language unifies them into a single "filter" construct:

SQL:

    SELECT country, MAX(salary) AS max_salary
    FROM employees
    WHERE start_date > DATE '2021-01-01'
    GROUP BY country
    HAVING MAX(salary) > 100000
PRQL:

    from employees
    filter start_date > @2021-01-01
    group country (
      aggregate {max_salary = max salary}
    )
    filter max_salary > 100_000

There are no comments on this comment yet.