# 탐색기 쿼리에서 투표 이름과 post\_id 찾기

**URL:** <https://meta.discourse.org/t/finding-poll-name-and-post-id-for-an-explorer-query/240986>\
**Category:** Data & reporting\
**Tags:** polls, sql-query\
**Created:** [2월 9, 2022, 5:04오전 UTC](https://meta.discourse.org/t/finding-poll-name-and-post-id-for-an-explorer-query/240986 "2022-02-09T05:04:12Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)\
**Post date:** [10월 5, 2022, 10:47오전 UTC](https://meta.discourse.org/t/finding-poll-name-and-post-id-for-an-explorer-query/240986/5 "2022-10-05T10:47:50Z")

</div>

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

```plaintext
-- [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

```

---

_[View the full topic](https://meta.discourse.org/t/finding-poll-name-and-post-id-for-an-explorer-query/240986)._
