I am trying to create a query to get specific rows on conditions and along with that, all the rows present in the table. I am using the following query for this
select name, email, count(users.id) OVER (PARTITION BY users.id) from users where user.city='new york';
with the count()
, I want to get the count of all the rows present irrespective of the where clause.
I am trying to reduce the query because right now in my list page view I am doing two queries one for count of all the records and other for the filtered list of records. But I want to do that in the single query.