Programming
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities [email protected]
Would it work to write the query as a common table expression, then select your columns from that table and join it with a count(*)
aggregation of the table?
In normal SQL you'd use a window function to do this but I don't know if mysql supports that.
Select count(*) from (select ...) ? See if the query optimizer pipelines that.
Maybe I misunderstand what you are trying to do.
The OP wants the paginated table data and the count. With a single query execution.