# Looking to find the number of content shares in the last month

**URL:** <https://meta.discourse.org/t/looking-to-find-the-number-of-content-shares-in-the-last-month/98050>\
**Category:** Data & reporting\
**Tags:** sql-query\
**Created:** [25.Сентябрь.2018 22:37:53 UTC](https://meta.discourse.org/t/looking-to-find-the-number-of-content-shares-in-the-last-month/98050 "2018-09-25T22:37:53Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![jerdog](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jerdog/32/122843_2.png) [@jerdog](https://meta.discourse.org/u/jerdog)\
**Post date:** [25.Сентябрь.2018 22:37:54 UTC](https://meta.discourse.org/t/looking-to-find-the-number-of-content-shares-in-the-last-month/98050/1 "2018-09-25T22:37:54Z")

</div>

I am working on a few queries for management, and one they want to know relates to the number of shared content, i.e. someone shares a link and it’s clicked. Here’s what I created but it’s giving me a number that doesn’t pass the plausibility check - 80k. Am I missing something?

```
-- [params]
-- string :interval = 1 month
-- string :trunc = month
with t as (
    select 
    date_trunc(:trunc, CURRENT_TIMESTAMP - INTERVAL :interval) as start,
    date_trunc(:trunc, CURRENT_TIMESTAMP) as end
)    
SELECT count(id) as "Total" 
FROM incoming_links i, t
WHERE i.created_at between t.start and t.end

```

---

_[View the full topic](https://meta.discourse.org/t/looking-to-find-the-number-of-content-shares-in-the-last-month/98050)._
