Hi, I've this table in MySQL.
It's from a website where you can post secrets and users can post comments to those secrets.
Columns are:
ID, post_date, content, comment_for
If post is new thread, comment_for will be null.
If post an answer to an existing secret, comment_for will be the ID of the original post.
ie:
Original post: ID = 100, DATE=2007-04-26, COMMENT_FOR=NULL, content=xxxxx
Reply: ID=999, DATE=2007-04-27 COMMENT_FOR=100, content=xxxxx
The point is that I need to know the most popular secrets (posts), and for doing it, I need to known the secrets with more answers.
How can I do that?
I known I have to use GROUP BY, but should I use a self referenced join or something like that?
Thanks in advance.
Diego.-