데이터 탐색기 - 투표 수

토픽 투표 테이블은 discourse_voting_topic_votes와 discourse_voting_votes입니다. 각 토픽의 투표 수를 포함하려면 다음과 같은 쿼리를 사용할 수 있습니다: :+1:


SELECT
    t.id AS topic_id,
    t.title AS topic_title,
    dvtv.votes_count,
    t.excerpt,
    t.like_count,
    ('https://our_community.com/t/' || t.slug || '/' || t.id) AS url
FROM 
    topics t
JOIN 
    discourse_voting_topic_vote_count dvtv ON t.id = dvtv.topic_id
WHERE 
    t.category_id = 95
AND 
    t.created_at > NOW() - INTERVAL '2 years'
AND deleted_at IS NULL

#data-reporting 카테고리에서 유용하게 사용할 수 있는 몇 가지 추가 쿼리도 있습니다 - Topics tagged topic-voting