题解 | #话题的分布情况#
话题的分布情况
https://www.nowcoder.com/practice/3f0d5c83b48b450888921b6189be288f
SELECT SUBSTRING_INDEX(subject_set, ',', 1) AS subject_id1, COUNT(SUBSTRING_INDEX(subject_set, ',', 1)) AS cnt FROM comment_detail WHERE SUBSTRING_INDEX(SUBSTRING_INDEX(subject_set, ',', 2), ',', -1) = '1002' GROUP BY subject_id1 ORDER BY subject_id1;