# Badge SQL Error: q.user\_id

**URL:** https://meta.discourse.org/t/badge-sql-error-q-user-id/86640
**Category:** Data & reporting
**Tags:** sql-triggered-badge
**Created:** [May 2, 2018, 9:13pm UTC](https://meta.discourse.org/t/badge-sql-error-q-user-id/86640 "2018-05-02T21:13:22Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![gerhard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gerhard/32/119479_2.png) [@gerhard](https://meta.discourse.org/u/gerhard)
#### Post date: [May 2, 2018, 9:35pm UTC](https://meta.discourse.org/t/badge-sql-error-q-user-id/86640/2 "2018-05-02T21:35:14Z")

</div>

Your query needs to return at least the following columns:

- `user_id`
- `granted_at `

Also, you should definitely take a look at [Add Badge to Solve answer - #2 by dax](https://meta.discourse.org/t/add-badge-to-solve-answer/79126/2). 😉

---

_[View the full topic](https://meta.discourse.org/t/badge-sql-error-q-user-id/86640)._
