Re: Can I get the number of results plus the results with a single query? - Mailing list pgsql-general

From David G. Johnston
Subject Re: Can I get the number of results plus the results with a single query?
Date
Msg-id CAKFQuwYR-kmTsRJDQ-2US_KR1jvjORceUMsO5jv9duZBrtZqwg@mail.gmail.com
Whole thread Raw
In response to Can I get the number of results plus the results with a single query?  (Perry Smith <pedz@easesoftware.com>)
Responses Re: ***SPAM*** Re: Can I get the number of results plus the results with a single query?
List pgsql-general
On Monday, August 15, 2022, Perry Smith <pedz@easesoftware.com> wrote:
I’ve been toying with row_number() and then sort by row_number descending and pick off the first row as the total number. 

Use count as a window function.

David J.
 

pgsql-general by date:

Previous
From: Perry Smith
Date:
Subject: Can I get the number of results plus the results with a single query?
Next
From: jian he
Date:
Subject: lateral join with union all