# Una insignia por tiempo de lectura?

**URL:** <https://meta.discourse.org/t/a-badge-for-reading-time/178482>\
**Category:** Data & reporting\
**Tags:** sql-triggered-badge\
**Created:** [4 Febrero, 2021 23:38 UTC](https://meta.discourse.org/t/a-badge-for-reading-time/178482 "2021-02-04T23:38:15Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![michebs](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michebs/32/190102_2.png) [@michebs](https://meta.discourse.org/u/michebs)\
**Post date:** [5 Febrero, 2021 09:47 UTC](https://meta.discourse.org/t/a-badge-for-reading-time/178482/3 "2021-02-05T09:47:15Z")

</div>

Esta consulta lista a los usuarios que pasaron más de 480 horas leyendo publicaciones. Espero que sea de ayuda.

```sql
-- conversión a milisegundos: [cantidad de horas * 3600000]: 480 * 3600000 = 1,728,000,000

WITH time_reading AS (
    SELECT 
        user_id, 
        SUM(msecs) AS horas 
    FROM post_timings 
    GROUP BY user_id
    HAVING SUM(msecs) >= 1728000000)

SELECT user_id, CURRENT_TIMESTAMP AS granted_at
FROM time_reading

```

---

_[View the full topic](https://meta.discourse.org/t/a-badge-for-reading-time/178482)._
