SELECT n.pk_id, count( DISTINCT r.user_id ) forwardNum FROM news_info n INNER JOIN news_info_record r ON r.type = 1 AND r.news_id = n.pk_id AND r.data_active = 0 AND n.data_active = 0 GROUP BY r.news_id
按照news_id分组统计,但是在user_id相同的时候不能统计在内
2023-01-10 20:12:14
SELECT n.pk_id, count( DISTINCT r.user_id ) forwardNum FROM news_info n INNER JOIN news_info_record r ON r.type = 1 AND r.news_id = n.pk_id AND r.data_active = 0 AND n.data_active = 0 GROUP BY r.news_id
按照news_id分组统计,但是在user_id相同的时候不能统计在内