# Benutzer-Likes herausfiltern, wenn Konto x Tage vor Themen-Erstellung erstellt wurde

**URL:** <https://meta.discourse.org/t/filter-users-likes-out-if-account-created-x-days-prior-to-topic-creation/232331>\
**Category:** Data & reporting\
**Tags:** sql-query\
**Created:** [8. Juli 2022 um 18:02 UTC](https://meta.discourse.org/t/filter-users-likes-out-if-account-created-x-days-prior-to-topic-creation/232331 "2022-07-08T18:02:07Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Matt0x01](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/matt0x01/32/264811_2.png) [@Matt0x01](https://meta.discourse.org/u/Matt0x01)\
**Post date:** [8. Juli 2022 um 18:02 UTC](https://meta.discourse.org/t/filter-users-likes-out-if-account-created-x-days-prior-to-topic-creation/232331/1 "2022-07-08T18:02:07Z")

</div>

Hallo,

Ich versuche, einen weiteren Filter hinzuzufügen, bei dem Benutzer, die weniger als 2 Tage vor der Erstellung eines bestimmten Themas erstellt wurden, nicht einbezogen werden.

Das habe ich versucht. Ich bin relativ neu in SQL und weiß nicht, wie ich vorgehen soll. Kann mir jemand helfen?

```sql
SELECT *
FROM topic t
INNER JOIN post_actions pa ON pa.post_id = t.id
INNER JOIN users u ON u.id = pa.user_id
WHERE t.id = 1
    AND pa.post_action_type_id = 2
    AND u.created_at < DATE(t.created_at, '-2 days')

```

---

_[View the full topic](https://meta.discourse.org/t/filter-users-likes-out-if-account-created-x-days-prior-to-topic-creation/232331)._
