# 데이터 탐색 쿼리에 주제에 대한 직접 링크 추가

**URL:** https://meta.discourse.org/t/adding-a-direct-link-to-a-topic-in-a-data-explorer-query/322914
**Category:** Data & reporting
**Tags:** data-explorer
**Created:** [8월 22, 2024, 3:48오후 UTC](https://meta.discourse.org/t/adding-a-direct-link-to-a-topic-in-a-data-explorer-query/322914 "2024-08-22T15:48:01Z")
**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: [8월 22, 2024, 4:08오후 UTC](https://meta.discourse.org/t/adding-a-direct-link-to-a-topic-in-a-data-explorer-query/322914/5 "2024-08-22T16:08:30Z")

</div>

데이터 탐색기에는 결과를 더 인터랙티브하게 만들어 주는 마법 별칭(magic aliases)이 여러 개 있습니다. 🪄 [Formatting Data Explorer Table Results](https://meta.discourse.org/t/formatting-data-explorer-table-results/277939)

이 중 많은 별칭은 어떤 테이블을 사용하느냐에 따라 자동으로 작동합니다. 예를 들어 `posts` 테이블에서 `topic_id`를 가져오면 해당 토픽으로 연결되는 인터랙티브 링크가 됩니다. 하지만 `topics` 테이블의 `id` 필드도 같은 효과를 내려면 별칭(`t.id AS topic_id`)을 추가해야 합니다. `users`와 `posts` 테이블도 마찬가지입니다.

> [@JammyDodger](#):
>
> ‘사이트 내’에서 보고서를 볼 때 토픽(또는 포스트 등) 테이블의 `id`를 별칭으로 지정하고 [data explorer](https://meta.discourse.org/t/32566?silent=true)의 마법을 이용해 이를 사용 가능한 링크로 변환할 수 있습니다:
> 
> ```plaintext
> SELECT 
> id AS topic_id
> FROM topics
> 
> ```

다만 결과를 내보내는 경우 이 별칭은 유지되지 않으며, 기본 id만 표시됩니다. 이를 해결하려면 moin이 제안한 대로 토픽 링크를 구성하고 이를 URL로 별칭을 지정하면 됩니다:

> [@JammyDodger](#):
>
> URL을 구성하고 `SOMETHING_url`로 별칭을 지정하여 하이퍼링크로 만들 수도 있습니다. 예시:
> 
> ```plaintext
> SELECT 
> 'https://meta.discourse.org/t/' || slug || '/' || id AS topic_url
> FROM topics
> 
> ```

---

_[View the full topic](https://meta.discourse.org/t/adding-a-direct-link-to-a-topic-in-a-data-explorer-query/322914)._
