# 게시물 URL이 저장된 테이블은 무엇인가요?

**URL:** <https://meta.discourse.org/t/which-table-holds-the-post-url/178333>\
**Category:** Development\
**Created:** [2월 3, 2021, 10:13오후 UTC](https://meta.discourse.org/t/which-table-holds-the-post-url/178333 "2021-02-03T22:13:47Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [2월 3, 2021, 10:17오후 UTC](https://meta.discourse.org/t/which-table-holds-the-post-url/178333/2 "2021-02-03T22:17:55Z")

</div>

SQL에서는 다음과 같습니다.

```sql
'/t/-' || topics.id || '/' || posts.post_number

```

예제에 적용하면 다음과 같습니다.

```sql
SELECT u.email,c.name as post_category, '/t/-' || t.id || '/' || p.post_number as post_url
 FROM posts p
left join user_emails u on p.user_id = u.user_id
left join topics t on p.topic_id=t.id
left join categories c on t.category_id = c.id
where p.created_at < '2021-03-01T00:00:00.000Z'
    GROUP BY
       u.email,u.user_id,c.name

```

---

_[View the full topic](https://meta.discourse.org/t/which-table-holds-the-post-url/178333)._
