# Últimos 7 dias de tópicos

**URL:** <https://meta.discourse.org/t/last-7-days-of-topics/85103>\
**Category:** Product Support\
**Created:** [Abril 11, 2018, 6:52pm UTC](https://meta.discourse.org/t/last-7-days-of-topics/85103 "2018-04-11T18:52:42Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![SidV](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sidv/32/119460_2.png) [@SidV](https://meta.discourse.org/u/SidV)\
**Post date:** [Abril 14, 2018, 5:00pm UTC](https://meta.discourse.org/t/last-7-days-of-topics/85103/9 "2018-04-14T17:00:23Z")

</div>

Great idea @Mittineague !

I took your code and add some new code 😉

I tested, works like a charm

```sql
--[params]
--string :interval = 1 week
--int :limit
SELECT id, 
CONCAT('<a href = "/t/', id, '">', title, '</a>') 
   AS html$topic,
   created_at as posted
FROM topics
WHERE age(created_at) < interval :interval
AND archetype != 'private_message'
GROUP BY id
ORDER BY created_at DESC
LIMIT :limit

```

_[v1.1 added](https://github.com/SidVal/discourse-data-explorer/blob/queries/queries/list-topics-week.sql)_ 🚀

---

_[View the full topic](https://meta.discourse.org/t/last-7-days-of-topics/85103)._
