public inbox for [email protected]  
help / color / mirror / Atom feed
From: Onni Hakala <[email protected]>
To: [email protected]
Subject: How can I create a feature request for QUALIFY clause into PostgreSQL?
Date: Mon, 3 Oct 2022 20:38:41 +0300
Message-ID: <[email protected]> (raw)

Hey,

I was very happy learn about QUALIFY clause in BigQuery <https://cloud.google.com/bigquery/docs/reference/standard-sql/query-syntax#qualify_clause; today.

I have used window functions usually with subqueries like this:
SELECT * FROM (
  SELECT
    *,
    ROW_NUMBER OVER (PARTITION BY something ORDER BY modified_date DESC) AS row_number
  FROM table_name
)
WHERE row_number = 1

With QUALIFY it's much more ergonomic and cleaner to do the same thing.
SELECT *
FROM table_name
QUALIFY ROW_NUMBER() OVER (PARTITION BY something ORDER BY modified_date DESC) = 1

QUALIFY is also better since it doesn't include extra column row_number to the result.

Where should I send message so that Postgres maintainers would consider adding this into the TODO page: https://wiki.postgresql.org/wiki/Todo <https://wiki.postgresql.org/wiki/Todo;

Thanks in advance,
Onni Hakala

view thread (6+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: How can I create a feature request for QUALIFY clause into PostgreSQL?
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox