# Last 7 days of topics

**URL:** <https://meta.discourse.org/t/last-7-days-of-topics/85103>\
**Category:** Product Support\
**Created:** [April 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:** 7

<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:** [April 13, 2018, 12:24pm UTC](https://meta.discourse.org/t/last-7-days-of-topics/85103/7 "2018-04-13T12:24:14Z")

</div>

> [@adamprocter](#):
>
> I assume limit is the number of results returned ? in case there are 1000’s ?

Limit is the number of results returned and you must SET the limit on your query before run it.  
See this:

 ![image](https://global.discourse-cdn.com/meta/original/3X/e/8/e8e2484b017d6778449d6dcd65e7cd42fdb12fde.png)

> [@adamprocter](#):
>
> How could I include URL in the results?

Try this:

```sql
--[params]
--string :interval = 1 week
--int :limit
SELECT tu.topic_id, t.title, t.created_at as posted
FROM topics t, topic_users tu
WHERE t.id = tu.topic_id 
AND age(t.created_at) < interval :interval
AND t.archetype != 'private_message'
GROUP BY tu.topic_id, t.title, t.created_at
ORDER BY t.created_at DESC
LIMIT :limit

```

---

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