Can anyone offer suggestions for the logic in a MySQL query that does the following:
- Selects at least 100 posts
- Selects all of the posts in the last month of loaded thoughts, e.g., if 100 posts loads posts half way through September, then the posts for the entire month of September should be loaded instead of cutting it off half way.
Unfortunately, the second option is not something I know is even possible with MySQL, so I’m reaching out for a little help.
Cheers.
just compute the month of the 100th row in a subquery and use the value in BETWEEN condition
What you basically need:
Thus,
The last query where the latter is used as subquery is your homework =)