# SQL query in Data Explorer to pull latest topics?

**URL:** <https://meta.discourse.org/t/sql-query-in-data-explorer-to-pull-latest-topics/63908>\
**Category:** Data & reporting\
**Tags:** sql-query\
**Created:** [June 4, 2017, 3:47pm UTC](https://meta.discourse.org/t/sql-query-in-data-explorer-to-pull-latest-topics/63908 "2017-06-04T15:47:22Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![meglio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/meglio/32/71444_2.png) [@meglio](https://meta.discourse.org/u/meglio)\
**Post date:** [June 5, 2017, 7:29pm UTC](https://meta.discourse.org/t/sql-query-in-data-explorer-to-pull-latest-topics/63908/8 "2017-06-05T19:29:20Z")

</div>

Yep, with SQL queries you can extract about any data that you need from Discourse.

Re date formatting, I might need to add an _ago_ filter, like [this one](https://github.com/KnpLabs/KnpTimeBundle).

Without AGO-ing, you can still format dates [with using native date filter](https://twig.sensiolabs.org/doc/2.x/filters/date.html).

You can also [format dates directly in you SQL query](https://www.postgresql.org/docs/9.6/static/functions-datetime.html).

---

_[View the full topic](https://meta.discourse.org/t/sql-query-in-data-explorer-to-pull-latest-topics/63908)._
