Q&A for medical specialists, students, dietitians, and anyone with health-related questions
/* What is the most number of comments on a single post? select id, commentcount from posts order by commentcount desc How many posts have the exact same number of answers? select answercount Tot_Ans_For_A_Post, count(id) Tot_Num_of_Post from posts group by answercount Bonus: What is the current highest scored comment, and what post does it belong to? */ /* select id, commentcount from posts order by commentcount desc select answercount Tot_Ans_For_A_Post, count(id) Tot_Num_of_Post from posts group by answercount */ select id Comment_ID, postid Post_ID, score Comment_Score from comments order by score desc select a.id, a.score, b.id from posts a, comments b where a.id = b.postid order by score desc /* select a.id, a.answercount, b.id, b.answercount from posts a, posts b where a.id != b.id and a.answercount = b.answercount */