# Consulta SQL para extrair todas as postagens com caixas de seleção desmarcadas

**URL:** <https://meta.discourse.org/t/sql-query-to-extract-all-posts-with-unchecked-checkboxes/291634>\
**Category:** Data & reporting\
**Tags:** sql-query\
**Created:** [15 Janeiro , 2024 00:37 UTC](https://meta.discourse.org/t/sql-query-to-extract-all-posts-with-unchecked-checkboxes/291634 "2024-01-15T00:37:25Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Arkshine](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/arkshine/32/298682_2.png) [@Arkshine](https://meta.discourse.org/u/Arkshine)\
**Post date:** [15 Janeiro , 2024 03:51 UTC](https://meta.discourse.org/t/sql-query-to-extract-all-posts-with-unchecked-checkboxes/291634/2 "2024-01-15T03:51:30Z")

</div>

Algo assim?\n\n```sql  
– [params]  
– int\_list :categories

SELECT p.id post\_id,  
t.id topic\_id,  
c.id category\_id,  
(regexp\_matches(p.raw, ‘\[\s\]\s\*[^]\r\n]+’, ‘g’))[1] AS html$excerpt  
FROM posts p  
JOIN topics t ON p.topic\_id = t.id  
JOIN categories c ON t.category\_id = c.id  
WHERE p.raw ~ ‘\[\s\]\s\*[^]\r\n]+’  
AND c.id IN (:categories)

```plaintext

![image|690x234](upload://m2eIUhCSc4oURZJAaSk6WWbIdfq.png)

Talvez eu tenha entendido algo errado, mas acredito que seria um bom ponto de partida.
```

---

_[View the full topic](https://meta.discourse.org/t/sql-query-to-extract-all-posts-with-unchecked-checkboxes/291634)._
