# איך לטפל ב-null id באלגנטיות

**URL:** <https://meta.discourse.org/t/how-to-handle-a-null-id-nicely/255801>\
**Category:** Data & reporting\
**Tags:** sql-query\
**Created:** [21 בפברואר,‏ 2023,‏ 4:29pm 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:** 1

<div class="post-metadata">

**Author:** ![ganncamp](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ganncamp/32/106199_2.png) [@ganncamp](https://meta.discourse.org/u/ganncamp)\
**Post date:** [21 בפברואר,‏ 2023,‏ 4:29pm UTC](https://meta.discourse.org/t/how-to-handle-a-null-id-nicely/255801/1 "2023-02-21T16:29:19Z")

</div>

Our workflow is to assign to groups & then (typically) the groups assign to individuals, and I’m working on reporting around that.

I’m ending up with things like this:

 ![Selection_822](https://global.discourse-cdn.com/meta/original/4X/0/3/5/035203f42802fe254eeb0edbdf6d937edbedac0d.png)

Ideally I’d be able to `COALESCE` those `NULL` user values to `''`. Except that’s a string, and what was selected was an integer (`user_id`), so I get an error. If I `COALESCE` it to 0, it looks equally bad, just in a different way.

Has anyone mastered this?

---

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