I ask to help with the formation of a query to the table. I don’t understand SQL queries at all, but the task was to display the number of responses to comments. There are 2 columns in the table:
- id (comment id)
- reply_to (with a value of 0 - if it is the head comment or given the id of the comment to which it is written, if it is the answer). There are no answers of the 3rd order, i.e. There is no answer to the answer.
The question is how to form a request to print the sum of responses to the head comment, i.e. collect values for reply_to for each id of the head comment equal to it, and summarize them?
For a tip or answers 500 advantages in karma, regardless of religion and other anti-scientific nonsense.