# SQL: The most N used words per user (speak their language!)

**URL:** https://meta.discourse.org/t/sql-the-most-n-used-words-per-user-speak-their-language/38556
**Category:** Data & reporting
**Tags:** sql-query
**Created:** [January 27, 2016, 5:55am UTC](https://meta.discourse.org/t/sql-the-most-n-used-words-per-user-speak-their-language/38556 "2016-01-27T05:55:21Z")
**Posts on this page:** 2
**Page:** 2

<div class="post-metadata">

### Author: ![DiscourseMetrics](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/discoursemetrics/32/55756_2.png) [@DiscourseMetrics](https://meta.discourse.org/u/DiscourseMetrics)
#### Post date: [May 17, 2019, 9:47pm UTC](https://meta.discourse.org/t/sql-the-most-n-used-words-per-user-speak-their-language/38556/21 "2019-05-17T21:47:32Z")

</div>

To answer myself, this seems to work decently:

```
SELECT word, count(*)
FROM ( 
  SELECT regexp_split_to_table(raw, ' ') as word
  FROM posts
  order by id desc
  limit 100000
) t
GROUP BY word
order by count(*) desc

```

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [June 8, 2024, 12:37pm UTC](https://meta.discourse.org/t/sql-the-most-n-used-words-per-user-speak-their-language/38556/22 "2024-06-08T12:37:08Z")

</div>

This topic was automatically closed after 3055 days. New replies are no longer allowed.

[Previous page](https://meta.discourse.org/t/sql-the-most-n-used-words-per-user-speak-their-language/38556.md?page=1)
