I save user inputs (comments) in these tables.
NEWS_COMMENTS
- id
- comment
PRODUCT_COMMENTS
- id
- comment
- product_id
I wanted to add a history feature to my website. Like;
-Someone commented on XX news.
-Someone commented on YY product.
-Someone commented on ZZ product.
You noticed the issue. I don't save timestamps or dates, so I can't be sure which comment comes first. It can be either the news comment or product comment.
Does MySQL has a feature to select last 24 hour inputs? For example,
NEWS_COMMENTS has 3 new entries in last 24 hours. PRODUCT_COMMENTS has 5 new entries in last 24 hours.
The query should select these 8 entries ordering by their entry date/timestamp.
Can I do this without altering my current pages? Can you provide a query?