# Is it possible to see who voted in polls?

**URL:** <https://meta.discourse.org/t/is-it-possible-to-see-who-voted-in-polls/27064>\
**Category:** Product Support\
**Created:** [1 Aprile 2015, 2:49pm UTC](https://meta.discourse.org/t/is-it-possible-to-see-who-voted-in-polls/27064 "2015-04-01T14:49:38Z")\
**Posts on this page:** 1\
**Showing post:** 26

<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:** [24 Settembre 2019, 6:12pm UTC](https://meta.discourse.org/t/is-it-possible-to-see-who-voted-in-polls/27064/26 "2019-09-24T18:12:45Z")

</div>

Ecco una query per impostare un livello di fiducia minimo per gli utenti.

```sql
-- [params]
-- post_id :post_id
-- text :poll_name = poll
-- integer :min_trust_level

SELECT u.id AS user_id, u.username, v.poll_option_id AS option_id, o.html AS option_html
FROM polls p
       JOIN poll_votes v ON (p.id = v.poll_id)
       JOIN poll_options o ON (o.id = v.poll_option_id)
       JOIN users u ON (v.user_id = u.id)
WHERE p.post_id = :post_id AND p.name = :poll_name
  AND u.trust_level >= :min_trust_level
ORDER BY u.username, v.poll_option_id

```

Ecco una query per mostrare solo gli utenti registrati da un certo numero di giorni.

```sql
-- [params]
-- post_id :post_id
-- text :poll_name = poll
-- integer :days_ago = 30

SELECT u.id AS user_id, u.username, v.poll_option_id AS option_id, o.html AS option_html
FROM polls p
       JOIN poll_votes v ON (p.id = v.poll_id)
       JOIN poll_options o ON (o.id = v.poll_option_id)
       JOIN users u ON (v.user_id = u.id)
WHERE p.post_id = :post_id AND p.name = :poll_name
  AND u.created_at < NOW() - INTERVAL ':days_ago days' 
ORDER BY u.username, v.poll_option_id

```

---

_[View the full topic](https://meta.discourse.org/t/is-it-possible-to-see-who-voted-in-polls/27064)._
