# null id를 깔끔하게 처리하는 방법

**URL:** <https://meta.discourse.org/t/how-to-handle-a-null-id-nicely/255801>\
**Category:** Data & reporting\
**Tags:** sql-query\
**Created:** [2월 21, 2023, 4:29오후 UTC](https://meta.discourse.org/t/how-to-handle-a-null-id-nicely/255801 "2023-02-21T16:29:19Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2월 23, 2023, 5:22오전 UTC](https://meta.discourse.org/t/how-to-handle-a-null-id-nicely/255801/2 "2023-02-23T05:22:07Z")

</div>

이 쿼리는 꽤 까다로운 것 같습니다. 데이터 탐색기 안에 어떤 닌자 HTML 기능이 있는 것 같아서, 기본적으로 다음과 같은 것을 사용하게 될 것입니다:

```plaintext
case when group_id IS NOT NULL
   then 'http://abc/groups/` || group_id::text
   else 'http://abc/user/` || user_id::text
end

```

그리고 나서 그 값으로 링크를 구성하면 됩니다. 하이퍼링크 없이 그룹/사용자 이름만 한 열에 표시하려는 경우라면 조금 더 쉽습니다.

현재 가지고 있는 SQL은 무엇인가요?

---

_[View the full topic](https://meta.discourse.org/t/how-to-handle-a-null-id-nicely/255801)._
