Is it possible to get the total count while fetching rows in a single query?
I have a query which looks like this:
I noticed that the 'count' only counts the result of the query and not all the rows in the table. Is it possible to make it to count all the rows in the table?
I'm using PG
4 Replies
Maybe use a window function?
How can I do that?
Because I had to separate them into 2 queries
One to get the data
And the other to get the count
It requires some smelly hackery, if you want a single count (not repeated per row)
not repeated per row would be a CTE