Advance SQL

I used advanced sql to group my table based on email.and now i want to use the sql output list in Outsystems table.im unable to get the total count (same as like aggregates) for the pagination.how to make pagination work on  advance sql.I have attached my structure and sql query

Screenshot 2023-11-20 at 10.02.26 PM.png
Screenshot 2023-11-20 at 10.01.52 PM.png
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.