탐색기 쿼리에서 투표 이름과 post_id 찾기

얼마 전 장난기 어린 조회용으로 간단한 탐색 쿼리를 하나 만들어 봤는데, json 메서드보다 더 쉬운지는 잘 모르겠어요. :slight_smile: 어쨌든 여기 있습니다:

-- [params]
-- int :topic_id
-- int :post_number = 1

SELECT pl.post_id, 
       p.id,
       pl.name
FROM polls pl
JOIN posts p ON p.id = pl.post_id
WHERE p.topic_id = :topic_id
AND p.post_number = :post_number